mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
move/rename folders
This commit is contained in:
parent
afa6baab2d
commit
d100f09bb2
1 changed files with 32 additions and 0 deletions
|
@ -4,6 +4,9 @@
|
||||||
*
|
*
|
||||||
* @package cake.console/shells
|
* @package cake.console/shells
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
App::uses('Folder', 'Utility');
|
||||||
|
|
||||||
class UpgradeShell extends Shell {
|
class UpgradeShell extends Shell {
|
||||||
|
|
||||||
protected $_files = array();
|
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.
|
* Update helpers.
|
||||||
*
|
*
|
||||||
|
@ -333,6 +361,10 @@ class UpgradeShell extends Shell {
|
||||||
'help' => 'Run all upgrade commands.',
|
'help' => 'Run all upgrade commands.',
|
||||||
'parser' => $subcommandParser
|
'parser' => $subcommandParser
|
||||||
))
|
))
|
||||||
|
->addSubcommand('locations', array(
|
||||||
|
'help' => 'Move files and folders to their new homes.',
|
||||||
|
'parser' => $subcommandParser
|
||||||
|
))
|
||||||
->addSubcommand('i18n', array(
|
->addSubcommand('i18n', array(
|
||||||
'help' => 'Update the i18n translation method calls.',
|
'help' => 'Update the i18n translation method calls.',
|
||||||
'parser' => $subcommandParser
|
'parser' => $subcommandParser
|
||||||
|
|
Loading…
Add table
Reference in a new issue