AJAX リクエストを介してコントローラーからシェルを実行しようとしています。
私のコントローラーで:
public function log_import() {
$this->autoRender = false;
App::import('Console/Command', 'AppShell');
App::import('Console/Command', 'IzigetlogShell');
$job = new IzigetlogShell();
$job->dispatchMethod('main');
echo "REPONSE";
}
そして私のシェル:
<?php
App::import('Core', 'Controller');
App::import('Controller', 'Suivis');
class IzilogShell extends AppShell {
public $uses = array('Suivi');
-- DU CODE --
$this->Suivi = new SuivisController();
$this->Suivi->constructClasses();
$exist_date = $this->Suivi->find('first',
array(
'conditions' => array('Suivi.date' => $date_calcul)
));
}
しかし、私は常に同じエラーメッセージを受け取ります: PHP Fatal error: Call to undefined method SuivisController::find() in C:\wamp\www\iziboxLogs\app\Console\Command\IzigetlogShell.php on line XX
コンソールからシェルを実行しようとしましたが、同じエラーが発生しました。
何か案は ?ありがとう、マーティン