mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-22 04:26:15 +00:00
upgrade shell - 'configure' subcommand
This commit is contained in:
parent
f200ee3d99
commit
78a376ebc4
1 changed files with 27 additions and 1 deletions
|
@ -104,7 +104,7 @@ class UpgradeShell extends Shell {
|
||||||
$patterns = array(
|
$patterns = array(
|
||||||
array(
|
array(
|
||||||
'a(*) -> array(*)',
|
'a(*) -> array(*)',
|
||||||
'/a\((.*)\)/',
|
'/\ba\((.*)\)/',
|
||||||
'array(\1)'
|
'array(\1)'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
@ -188,6 +188,28 @@ class UpgradeShell extends Shell {
|
||||||
$this->_filesRegexpUpdate($patterns);
|
$this->_filesRegexpUpdate($patterns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update Configure::read() calls with no params.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function configure() {
|
||||||
|
$this->_paths = array(
|
||||||
|
APP
|
||||||
|
);
|
||||||
|
if (!empty($this->params['plugin'])) {
|
||||||
|
$this->_paths = array(App::pluginPath($this->params['plugin']));
|
||||||
|
}
|
||||||
|
$patterns = array(
|
||||||
|
array(
|
||||||
|
"Configure::read() -> Configure::read('debug')",
|
||||||
|
'/Configure::read\(\)/',
|
||||||
|
'Configure::read(\'debug\')'
|
||||||
|
),
|
||||||
|
);
|
||||||
|
$this->_filesRegexpUpdate($patterns);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates files based on regular expressions.
|
* Updates files based on regular expressions.
|
||||||
*
|
*
|
||||||
|
@ -281,6 +303,10 @@ class UpgradeShell extends Shell {
|
||||||
->addSubcommand('request', array(
|
->addSubcommand('request', array(
|
||||||
'help' => 'Update removed request access, and replace with $this->request.',
|
'help' => 'Update removed request access, and replace with $this->request.',
|
||||||
'parser' => $subcommandParser
|
'parser' => $subcommandParser
|
||||||
|
))
|
||||||
|
->addSubcommand('configure', array(
|
||||||
|
'help' => "Update Configure::read() to Configure::read('debug')",
|
||||||
|
'parser' => $subcommandParser
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue