CakePHP Shell cronjob : Error: Class TestingShell could not be loaded

标签 cakephp cron

我正在尝试在 CakePHP 工作中获得一个 cronjob。但我收到此错误:错误:无法加载类TestingShell。

这是我的/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/apptesting

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

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

最佳答案

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

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

快速修复是回滚到 1.3.7。

关于CakePHP Shell cronjob : Error: Class TestingShell could not be loaded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5809210/

相关文章:

php - 使用正则表达式的 CakePHP 路由

php - Cakephp 测试数据库 - 模型问题

php - CakePHP Auth 允许 JSON 扩展

javascript - 如何根据用户时区设置提醒并根据时区发送通知?

python - 如何使用 BlockingScheduler 每 10 分钟运行一次任务 5 秒?

cakephp - 仅从 CakePHP 中的关联模型中选择某些字段

python - 无法通过 sh/crontab 启动 python 程序

linux - 如何在 Amazon Linux AMI 上设置 cron 作业

python - 在Ubuntu16.04上,如何重复运行python脚本-使用crontab

mysql - 在 cakephp 中命名表