mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
updating shells for new App::import
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6078 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
b6b192fda6
commit
838dd9022d
3 changed files with 8 additions and 10 deletions
|
@ -221,21 +221,19 @@ class ApiShell extends Shell {
|
||||||
function __loadDependencies($element) {
|
function __loadDependencies($element) {
|
||||||
switch(low($element)) {
|
switch(low($element)) {
|
||||||
case 'behavior':
|
case 'behavior':
|
||||||
loadModel(null);
|
App::import('Model', 'AppModel');
|
||||||
loadBehavior(null);
|
App::import('Model', 'ModelBehavior');
|
||||||
break;
|
break;
|
||||||
case 'controller':
|
case 'controller':
|
||||||
loadController(null);
|
App::import('Controller', 'AppController');
|
||||||
break;
|
break;
|
||||||
case 'component':
|
case 'component':
|
||||||
loadComponent(null);
|
|
||||||
break;
|
break;
|
||||||
case 'helper':
|
case 'helper':
|
||||||
uses('view'.DS.'helper');
|
App::import('Helper', 'AppHelper');
|
||||||
loadHelper(null);
|
|
||||||
break;
|
break;
|
||||||
case 'model':
|
case 'model':
|
||||||
loadModel(null);
|
App::import('Model', 'ModelBehavior');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,7 +458,7 @@ class ControllerTask extends Shell {
|
||||||
*/
|
*/
|
||||||
function __bakeTest($className) {
|
function __bakeTest($className) {
|
||||||
$out = '<?php '."\n\n";
|
$out = '<?php '."\n\n";
|
||||||
$out .= "loadController('$className');\n\n";
|
$out .= "App::import('Controller', '$className');\n\n";
|
||||||
$out .= "class {$className}ControllerTestCase extends CakeTestCase {\n";
|
$out .= "class {$className}ControllerTestCase extends CakeTestCase {\n";
|
||||||
$out .= "\tvar \$TestObject = null;\n\n";
|
$out .= "\tvar \$TestObject = null;\n\n";
|
||||||
$out .= "\tfunction setUp() {\n\t\t\$this->TestObject = new {$className}Controller();\n";
|
$out .= "\tfunction setUp() {\n\t\t\$this->TestObject = new {$className}Controller();\n";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
\<?php
|
||||||
/* SVN FILE: $Id$ */
|
/* SVN FILE: $Id$ */
|
||||||
/**
|
/**
|
||||||
* The View Tasks handles creating and updating view files.
|
* The View Tasks handles creating and updating view files.
|
||||||
|
@ -225,7 +225,7 @@ class ViewTask extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
$controllerClassName = $this->controllerName . 'Controller';
|
$controllerClassName = $this->controllerName . 'Controller';
|
||||||
if (!class_exists($this->controllerName . 'Controller') && !loadController($this->controllerName)) {
|
if (!class_exists($this->controllerName . 'Controller') && !App::import('Controller', $this->controllerName)) {
|
||||||
$file = CONTROLLERS . $this->controllerPath . '_controller.php';
|
$file = CONTROLLERS . $this->controllerPath . '_controller.php';
|
||||||
$shortPath = $this->shortPath($file);
|
$shortPath = $this->shortPath($file);
|
||||||
$this->err("The file '{$shortPath}' could not be found.\nIn order to bake a view, you'll need to first create the controller.");
|
$this->err("The file '{$shortPath}' could not be found.\nIn order to bake a view, you'll need to first create the controller.");
|
||||||
|
|
Loading…
Reference in a new issue