diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index bcf9255dcf1..1071491a7f9 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -20,6 +20,18 @@ function startup() { $this->out('Dry-run mode enabled!', 1, Shell::QUIET); } } + + function all() { + foreach($this->OptionParser->subcommands() as $command) { + $name = $command->name(); + if ($name === 'all') { + continue; + } + $this->out('Running ' . $name); + $this->$name(); + } + } + /** * Update helpers. * @@ -317,6 +329,10 @@ function getOptionParser() { return parent::getOptionParser() ->description("A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" . "Be sure to have a backup of your application before running these commands.") + ->addSubcommand('all', array( + 'help' => 'Run all upgrade commands.', + 'parser' => $subcommandParser + )) ->addSubcommand('i18n', array( 'help' => 'Update the i18n translation method calls.', 'parser' => $subcommandParser