Skip to content

Commit

Permalink
move/rename folders
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed May 1, 2011
1 parent afa6baa commit d100f09
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -4,6 +4,9 @@
*
* @package cake.console/shells
*/

App::uses('Folder', 'Utility');

class UpgradeShell extends Shell {

protected $_files = array();
Expand Down Expand Up @@ -32,6 +35,31 @@ function all() {
}
}

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.
*
Expand Down Expand Up @@ -333,6 +361,10 @@ function getOptionParser() {
'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
Expand Down

0 comments on commit d100f09

Please sign in to comment.