tags:

views:

54

answers:

1

Hi,

I can't seem to import a plugin model when running controller from the cron_dispatcher. Here is a simple test result.

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

  1. running from web ......... [WORKS]
  2. running testA function WITHOUT model import from cmd line......... [WORKS]
  3. running testB function WITH model import from cmd line......... [FAILED] - No errors given

code:

class CronsController extends PluginAppController {

    var $uses = array();

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

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

            echo 'Working';
            die;
    } 
A: 

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

cdburgess
hi,thanks for getting back to me. As usual the issue was my doing. I had some custom code in the database.php file that was the problem.-trav
hames