CakePHP Shell cronjob:错误:无法加载类TestingShell

时间:2011-04-27 19:07:22

标签: cakephp cron

我想在CakePHP工作中获得一个cronjob。但是我收到了这个错误:Error: Class TestingShell could not be loaded.

这是我的/app/vendors/shells/testing.php文件:

class TestingShell extends Shell    {
var $uses = array('Test');
function main(){
    $this->out('Number of tests :');
    $this->out($this->Test->find('count'));
    $this->out('.');
    if($this->Test->delete(1)){
        $this->out('test deleted'); 
    }
    else{
        $this->out('test not deleted'); 
    }
}

}

我这样称呼cronjob:/home/root/public_html/site/cake/console/cake -app /home/root/public_html/site/app testing

我做错了什么?非常感谢你!

编辑我必须补充说,在本地,shell工作正常。

2 个答案:

答案 0 :(得分:2)

查看此错误报告 - 这是我的问题。

http://cakephp.lighthouseapp.com/projects/42648/tickets/1601-cakephp-138-console-ignores-app-parameter

快速修复回滚到1.3.7。

答案 1 :(得分:1)

看看这个,你可能还需要添加的shell脚本

http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs

你也有错误的方式,它的

1 * * * * cake/path scritp params -app app/path

相关问题