mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fixing more path generation for plugins, and typo from previous commit
This commit is contained in:
parent
147b04ab59
commit
b1e74cff5b
2 changed files with 15 additions and 18 deletions
|
@ -107,19 +107,16 @@ class PluginTask extends Shell {
|
||||||
$Folder = new Folder($this->path . $pluginPath);
|
$Folder = new Folder($this->path . $pluginPath);
|
||||||
$directories = array(
|
$directories = array(
|
||||||
'config' . DS . 'schema',
|
'config' . DS . 'schema',
|
||||||
'models' . DS . 'behaviors',
|
'Model' . DS . 'Behavior',
|
||||||
'models' . DS . 'datasources',
|
'Model' . DS . 'Datasource',
|
||||||
'console' . DS . 'shells' . DS . 'tasks',
|
'Console' . DS . 'Command' . DS . 'Task',
|
||||||
'controllers' . DS . 'components',
|
'Controller' . DS . 'Component',
|
||||||
'libs',
|
'Lib',
|
||||||
'views' . DS . 'helpers',
|
'View' . DS . 'Helper',
|
||||||
'tests' . DS . 'cases' . DS . 'components',
|
'tests' . DS . 'Case' . DS . 'Controller' . DS . 'Component',
|
||||||
'tests' . DS . 'cases' . DS . 'helpers',
|
'tests' . DS . 'Case' . DS . 'View' . DS . 'Helper',
|
||||||
'tests' . DS . 'cases' . DS . 'behaviors',
|
'tests' . DS . 'Case' . DS . 'Model' . DS . 'Behavior',
|
||||||
'tests' . DS . 'cases' . DS . 'controllers',
|
'tests' . DS . 'Fixture',
|
||||||
'tests' . DS . 'cases' . DS . 'models',
|
|
||||||
'tests' . DS . 'groups',
|
|
||||||
'tests' . DS . 'fixtures',
|
|
||||||
'vendors',
|
'vendors',
|
||||||
'webroot'
|
'webroot'
|
||||||
);
|
);
|
||||||
|
@ -139,21 +136,21 @@ class PluginTask extends Shell {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$controllerFileName = $pluginPath . '_app_controller.php';
|
$controllerFileName = $plugin . 'AppController.php';
|
||||||
|
|
||||||
$out = "<?php\n\n";
|
$out = "<?php\n\n";
|
||||||
$out .= "class {$plugin}AppController extends AppController {\n\n";
|
$out .= "class {$plugin}AppController extends AppController {\n\n";
|
||||||
$out .= "}\n\n";
|
$out .= "}\n\n";
|
||||||
$out .= "?>";
|
$out .= "?>";
|
||||||
$this->createFile($this->path . $pluginPath. DS . $controllerFileName, $out);
|
$this->createFile($this->path . $pluginPath. DS . 'Controller' . DS . $controllerFileName, $out);
|
||||||
|
|
||||||
$modelFileName = $pluginPath . '_app_model.php';
|
$modelFileName = $plugin . 'AppModel.php';
|
||||||
|
|
||||||
$out = "<?php\n\n";
|
$out = "<?php\n\n";
|
||||||
$out .= "class {$plugin}AppModel extends AppModel {\n\n";
|
$out .= "class {$plugin}AppModel extends AppModel {\n\n";
|
||||||
$out .= "}\n\n";
|
$out .= "}\n\n";
|
||||||
$out .= "?>";
|
$out .= "?>";
|
||||||
$this->createFile($this->path . $pluginPath . DS . $modelFileName, $out);
|
$this->createFile($this->path . $pluginPath . DS . 'Model' . DS . $modelFileName, $out);
|
||||||
|
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__d('cake_console', '<success>Created:</success> %s in %s', $plugin, $this->path . $pluginPath), 2);
|
$this->out(__d('cake_console', '<success>Created:</success> %s in %s', $plugin, $this->path . $pluginPath), 2);
|
||||||
|
|
|
@ -75,6 +75,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
App::uses('Dispatcher', 'Dispatcher');
|
App::uses('Dispatcher', 'Routing');
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
$Dispatcher->dispatch(new CakeRequest());
|
$Dispatcher->dispatch(new CakeRequest());
|
||||||
|
|
Loading…
Add table
Reference in a new issue