mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Revert "Changing the Plugin task to take the dirs to create from the App skeleton"
This reverts commit fe8b641cd3257b4aa82ce93ac8a2e8f624e4ec58. Conflicts: cake/console/libs/tasks/plugin.php
This commit is contained in:
parent
db6f2cec96
commit
20b1dd795d
2 changed files with 30 additions and 15 deletions
|
@ -139,20 +139,30 @@ class PluginTask extends Shell {
|
|||
if (strtolower($looksGood) == 'y') {
|
||||
$verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n');
|
||||
|
||||
$skel = CAKE_CORE_INCLUDE_PATH . DS . dirname(CONSOLE_LIBS) . DS . 'templates' . DS . 'skel';
|
||||
$Skel =& new Folder($skel);
|
||||
$Folder =& new Folder($this->path . $pluginPath);
|
||||
$allFiles = $Skel->findRecursive();
|
||||
$directories = array();
|
||||
foreach($allFiles as $file) {
|
||||
$dir = ltrim(str_replace($skel, '', dirname($file)), DS);
|
||||
if (!$dir || preg_match('@^(tmp|plugins)@', $dir) || in_array($dir, $directories)) {
|
||||
continue;
|
||||
}
|
||||
$dirPath = $this->path . $pluginPath . DS . $dir;
|
||||
$directories = array(
|
||||
'config' . DS . 'schema',
|
||||
'models' . DS . 'behaviors',
|
||||
'models' . DS . 'datasources',
|
||||
'controllers' . DS . 'components',
|
||||
'views' . DS . 'helpers',
|
||||
'tests' . DS . 'cases' . DS . 'components',
|
||||
'tests' . DS . 'cases' . DS . 'helpers',
|
||||
'tests' . DS . 'cases' . DS . 'behaviors',
|
||||
'tests' . DS . 'cases' . DS . 'controllers',
|
||||
'tests' . DS . 'cases' . DS . 'models',
|
||||
'tests' . DS . 'groups',
|
||||
'tests' . DS . 'fixtures',
|
||||
'vendors' . DS . 'img',
|
||||
'vendors' . DS . 'js',
|
||||
'vendors' . DS . 'css',
|
||||
'vendors' . DS . 'shells' . DS . 'tasks'
|
||||
);
|
||||
|
||||
foreach ($directories as $directory) {
|
||||
$dirPath = $this->path . $pluginPath . DS . $directory;
|
||||
$Folder->create($dirPath);
|
||||
$File =& new File($dirPath . DS . 'empty', true);
|
||||
$directories[] = $dir;
|
||||
}
|
||||
|
||||
if (strtolower($verbose) == 'y') {
|
||||
|
|
|
@ -38,7 +38,6 @@ if (!class_exists('ShellDispatcher')) {
|
|||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php';
|
||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
|
||||
|
||||
|
||||
Mock::generatePartial(
|
||||
'ShellDispatcher', 'TestPluginTaskMockShellDispatcher',
|
||||
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
|
||||
|
@ -116,14 +115,19 @@ class PluginTaskTest extends CakeTestCase {
|
|||
$this->assertTrue(is_dir($path), 'No plugin dir %s');
|
||||
|
||||
$this->assertTrue(is_dir($path . DS . 'config'), 'No config dir %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'config' . DS . 'sql'), 'No config dir %s');
|
||||
$this->assertTrue(file_exists($path . DS . 'config' . DS . 'sql' . DS . 'empty'), 'No empty file %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'config' . DS . 'schema'), 'No schema dir %s');
|
||||
$this->assertTrue(file_exists($path . DS . 'config' . DS . 'schema' . DS . 'empty'), 'No empty file %s');
|
||||
|
||||
$this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s');
|
||||
$this->assertTrue(file_exists($path . DS . 'controllers' . DS . 'components' . DS . 'empty'), 'No empty file %s');
|
||||
|
||||
$this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s');
|
||||
$this->assertTrue(file_exists($path . DS . 'models' . DS . 'behaviors' . DS . 'empty'), 'No empty file %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'models' . DS . 'datasources'), 'No datasources dir %s');
|
||||
debug($path . DS . 'models' . DS . 'datsources' . DS . 'empty');
|
||||
$this->assertTrue(file_exists($path . DS . 'models' . DS . 'datasources' . DS . 'empty'), 'No empty file %s');
|
||||
die;
|
||||
|
||||
$this->assertTrue(is_dir($path . DS . 'views'), 'No views dir %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'views' . DS . 'helpers'), 'No helpers dir %s');
|
||||
|
@ -179,7 +183,8 @@ class PluginTaskTest extends CakeTestCase {
|
|||
$this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'img' . DS . 'empty'), 'No empty file %s');
|
||||
|
||||
$this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'shells'), 'No vendors shells dir %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'shells' . DS . 'tasks'), 'No vendors shells dir %s');
|
||||
$this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'shells' . 'empty'), 'No empty file %s');
|
||||
$this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'shells' . DS . 'tasks'), 'No vendors shells tasks dir %s');
|
||||
$this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'shells' . DS . 'tasks' . DS . 'empty'), 'No empty file %s');
|
||||
|
||||
$file = $path . DS . 'bake_test_plugin_app_controller.php';
|
||||
|
|
Loading…
Add table
Reference in a new issue