Skip to content
Browse files

upgrade shell - 'configure' subcommand

  • Loading branch information...
1 parent f200ee3 commit 78a376ebc40bc17701462bb8b23391f3b80c7664 @evilbloodydemon committed
Showing with 27 additions and 1 deletion.
  1. +27 −1 cake/console/shells/upgrade.php
View
28 cake/console/shells/upgrade.php
@@ -104,7 +104,7 @@ public function basics() {
$patterns = array(
array(
'a(*) -> array(*)',
- '/a\((.*)\)/',
+ '/\ba\((.*)\)/',
'array(\1)'
),
array(
@@ -189,6 +189,28 @@ public function request() {
}
/**
+ * 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.
*
* @param array $patterns Array of search and replacement patterns.
@@ -281,6 +303,10 @@ function getOptionParser() {
->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
));
}
}

0 comments on commit 78a376e

Please sign in to comment.
Something went wrong with that request. Please try again.