cakephp shell使用“不工作”
我使用cakephp shell使用“不工作”,php,shell,cakephp,plugins,model,Php,Shell,Cakephp,Plugins,Model,我使用public$uses=array('PluginA.modelclas1')在shell中加载插件模型类。在命令行中运行shell时,出现以下错误: Mac:Console charles$ ./cake PluginA.do_something test CAMPAIGN -c 1 Notice Error: Undefined property: DoSomethingShell::$ModelClass1 in [/Users/charles/Workspace/PHP/Proje
public$uses=array('PluginA.modelclas1')
在shell中加载插件模型类。在命令行中运行shell时,出现以下错误:
Mac:Console charles$ ./cake PluginA.do_something test CAMPAIGN -c 1
Notice Error: Undefined property: DoSomethingShell::$ModelClass1 in [/Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/Shell.php, line 443]
PHP Fatal error: Call to a member function exists() on a non-object in /Users/charles/Workspace/PHP/ProjectA/app/Plugin/PluginA/Console/Command/DoSomethingShell.php on line 91
PHP Stack trace:
PHP 1. {main}() /Users/charles/Workspace/PHP/ProjectA/app/Console/cake.php:0
PHP 2. ShellDispatcher::run() /Users/charles/Workspace/PHP/ProjectA/app/Console/cake.php:37
PHP 3. ShellDispatcher->dispatch() /Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/ShellDispatcher.php:68
PHP 4. Shell->runCommand() /Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/ShellDispatcher.php:200
PHP 5. DoSomethingShell->test() /Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/Shell.php:389
Fatal error: Call to a member function exists() on a non-object in /Users/charles/Workspace/PHP/ProjectA/app/Plugin/PluginA/Console/Command/DoSomethingShell.php on line 91
Call Stack:
0.0003 228248 1. {main}() /Users/charles/Workspace/PHP/ProjectA/app/Console/cake.php:0
0.0010 314344 2. ShellDispatcher::run() /Users/charles/Workspace/PHP/ProjectA/app/Console/cake.php:37
0.0153 2075240 3. ShellDispatcher->dispatch() /Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/ShellDispatcher.php:68
0.0201 2416216 4. Shell->runCommand() /Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/ShellDispatcher.php:200
0.0262 3250056 5. DoSomethingShell->test() /Users/charles/Workspace/PHP/ProjectA/lib/Cake/Console/Shell.php:389
Fatal Error Error: Call to a member function exists() on a non-object in [/Users/charles/Workspace/PHP/ProjectA/app/Plugin/PluginA/Console/Command/DoSomethingShell.php, line 91]
shell和加载的模型类都在PluginAPluginA
中。在modelclas1
中,有一个名为exists()
的方法
提前谢谢 可能是重复的我尝试了相同的设置,它似乎工作。你能从shell中粘贴更多的代码吗?你是在/app还是/app/Console中?尝试将cd'ing返回到/app并执行/Console/cake PluginA.do_something测试活动-c 1非常感谢您的帮助!在我更新PHP之后,这个问题就消失了。也许我没有正确设置PHP和cakePHP。