Thanks to Abdou Tahiri and Kai for explaining what was missing. I just needed an App::uses
call in the scripts that inherit from CronShell
. Here's the working TestShell
:
App::uses('CronShell', 'Console/Command');
class TestShell extends CronShell {
public function startup() {
// Omit the startup message.
return;
}
public function main() {
$this->out('test');
$this->out('out');
$this->out('the');
$this->out('class');
}
}