mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
commit
cd9c135c88
1 changed files with 26 additions and 0 deletions
|
@ -500,6 +500,29 @@ class UpgradeShell extends AppShell {
|
||||||
$this->_filesRegexpUpdate($patterns);
|
$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.
|
* Update components.
|
||||||
*
|
*
|
||||||
|
@ -840,6 +863,9 @@ class UpgradeShell extends AppShell {
|
||||||
))->addSubcommand('constants', array(
|
))->addSubcommand('constants', array(
|
||||||
'help' => __d('cake_console', "Replace Obsolete constants"),
|
'help' => __d('cake_console', "Replace Obsolete constants"),
|
||||||
'parser' => $subcommandParser
|
'parser' => $subcommandParser
|
||||||
|
))->addSubcommand('controller_redirects', array(
|
||||||
|
'help' => __d('cake_console', 'Return early on controller redirect calls.'),
|
||||||
|
'parser' => $subcommandParser
|
||||||
))->addSubcommand('components', array(
|
))->addSubcommand('components', array(
|
||||||
'help' => __d('cake_console', 'Update components to extend Component class.'),
|
'help' => __d('cake_console', 'Update components to extend Component class.'),
|
||||||
'parser' => $subcommandParser
|
'parser' => $subcommandParser
|
||||||
|
|
Loading…
Add table
Reference in a new issue