Merge pull request #2601 from dereuromark/2.5-upgrade

2.5 upgrade
This commit is contained in:
Mark Story 2014-01-07 06:43:10 -08:00
commit cd9c135c88

View file

@ -500,6 +500,29 @@ class UpgradeShell extends AppShell {
$this->_filesRegexpUpdate($patterns);
}
/**
* Update controller redirects.
*
* - Make redirect statements return early.
*
* @return void
*/
public function controller_redirects() {
$this->_paths = App::Path('Controller');
if (!empty($this->params['plugin'])) {
$this->_paths = App::Path('Controller', $this->params['plugin']);
}
$patterns = array(
array(
'$this->redirect() to return $this->redirect()',
'/\t\$this-\>redirect\(/',
"\t" . 'return $this->redirect('
),
);
$this->_filesRegexpUpdate($patterns);
}
/**
* Update components.
*
@ -840,6 +863,9 @@ class UpgradeShell extends AppShell {
))->addSubcommand('constants', array(
'help' => __d('cake_console', "Replace Obsolete constants"),
'parser' => $subcommandParser
))->addSubcommand('controller_redirects', array(
'help' => __d('cake_console', 'Return early on controller redirect calls.'),
'parser' => $subcommandParser
))->addSubcommand('components', array(
'help' => __d('cake_console', 'Update components to extend Component class.'),
'parser' => $subcommandParser