move/rename folders

This commit is contained in:
AD7six 2011-05-01 22:40:40 +02:00
parent afa6baab2d
commit d100f09bb2

View file

@ -4,6 +4,9 @@
*
* @package cake.console/shells
*/
App::uses('Folder', 'Utility');
class UpgradeShell extends Shell {
protected $_files = array();
@ -32,6 +35,31 @@ class UpgradeShell extends Shell {
}
}
function locations() {
$moves = array(
'controllers' . DS . 'components' => 'Controller' . DS . 'Component',
'controllers' => 'Controller',
'libs' => 'Lib',
'models' . DS . 'behaviors' => 'Model' . DS . 'Behavior',
'models' . DS . 'datasources' => 'Model' . DS . 'Datasource',
'models' => 'Model',
'tests' . DS . 'cases' => 'tests' . DS . 'Case',
'tests' . DS . 'fixtures' => 'tests' . DS . 'Fixture',
'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'templates',
'vendors' . DS . 'shells' => 'Console' . DS . 'Command',
'views' . DS . 'helpers' => 'View' . DS . 'Helper',
'views' => 'View'
);
foreach($moves as $old => $new) {
if (is_dir($old)) {
$this->out("Moving $old to $new");
$Folder = new Folder($old);
$Folder->move($new);
}
}
}
/**
* Update helpers.
*
@ -333,6 +361,10 @@ class UpgradeShell extends Shell {
'help' => 'Run all upgrade commands.',
'parser' => $subcommandParser
))
->addSubcommand('locations', array(
'help' => 'Move files and folders to their new homes.',
'parser' => $subcommandParser
))
->addSubcommand('i18n', array(
'help' => 'Update the i18n translation method calls.',
'parser' => $subcommandParser