Skip to content
Permalink
Browse files

Add upgrade command for Log::config.

  • Loading branch information...
markstory committed Dec 8, 2012
1 parent 024b84e commit 9ccf05126e2b7f5fd61fae92b6c97edd9a49f76d
Showing with 24 additions and 0 deletions.
  1. +24 −0 lib/Cake/Console/Command/UpgradeShell.php
@@ -244,6 +244,30 @@ public function namespaces() {
$this->out(__d('cake_console', '<success>Namespaces added successfully</success>'));
}
/**
* Update log configs.
*
* @return void
*/
public function log() {
$path = $this->_getPath();
$Folder = new Folder($path);
$this->_paths = $Folder->tree(null, false, 'dir');
$this->_findFiles('php');
foreach ($this->_files as $filePath) {
$patterns = [
[
' Log::config to Configure::write',
'#(Log\:\:config\()(\s*[\'"])([^\'"]+)([\'"])#ms',
"Configure::write('Log.\\3'",
]
];
$this->_updateFile($filePath, $patterns);
}
$this->out(__d('cake_console', '<success>Log::config() replaced successfully</success>'));
}
/**
* Update cache configs.
*

0 comments on commit 9ccf051

Please sign in to comment.
You can’t perform that action at this time.