From b5d602e491b612b3d09ca4e86d5ed2a7d09ab847 Mon Sep 17 00:00:00 2001 From: evilbloodydemon Date: Sun, 19 Dec 2010 17:06:45 +0300 Subject: [PATCH] upgrade shell - 'configure' subcommand --- cake/console/shells/upgrade.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/cake/console/shells/upgrade.php b/cake/console/shells/upgrade.php index a54899c95..bd278daa6 100644 --- a/cake/console/shells/upgrade.php +++ b/cake/console/shells/upgrade.php @@ -104,7 +104,7 @@ class UpgradeShell extends Shell { $patterns = array( array( 'a(*) -> array(*)', - '/a\((.*)\)/', + '/\ba\((.*)\)/', 'array(\1)' ), array( @@ -188,6 +188,28 @@ class UpgradeShell extends Shell { $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. * @@ -281,6 +303,10 @@ class UpgradeShell extends Shell { ->addSubcommand('request', array( 'help' => 'Update removed request access, and replace with $this->request.', 'parser' => $subcommandParser + )) + ->addSubcommand('configure', array( + 'help' => "Update Configure::read() to Configure::read('debug')", + 'parser' => $subcommandParser )); } } \ No newline at end of file