0

从 cron_dispatcher 运行控制器时,我似乎无法导入插件模型。这是一个简单的测试结果。

版本:1.3.2 cron_dispatcher:http ://tricks.cakephp.in.th/comland-line-and-cronjob

  1. 从网络运行...... [工作]
  2. 运行 testA 函数,没有从 cmd 行导入模型......... [WORKS]
  3. 从 cmd 行运行带有模型导入的 testB 函数......... [FAILED] - 没有给出错误

代码:

类 CronsController 扩展 PluginAppController {

    var $uses = array();

    function testA()
    {
            echo 'Working';
            die;
    }

    function testB()
    {
            App::import('Model', 'Plugin.Report');
            $report = new Report();

            echo 'Working';
            die;
    } 
4

1 回答 1

1

Hmmmm. I wonder if a shell would work better? (http://www.utoxin.name/2009/07/cakephp-shells-and-cron-jobs/)

于 2010-08-20T02:56:54.653 回答