2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
2008-01-08 07:37:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage cron
|
|
|
|
*/
|
|
|
|
|
2007-07-19 12:40:28 +02:00
|
|
|
/**
|
2008-01-09 05:18:36 +01:00
|
|
|
* Base class invoked from CLI rather than the webserver (Cron jobs, handling email bounces)
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage cron
|
|
|
|
*/
|
2007-07-19 12:40:28 +02:00
|
|
|
abstract class CliController extends Controller {
|
|
|
|
function init() {
|
|
|
|
$this->disableBasicAuth();
|
|
|
|
parent::init();
|
|
|
|
}
|
|
|
|
|
|
|
|
function index() {
|
|
|
|
foreach( ClassInfo::subclassesFor( $this->class ) as $subclass ) {
|
|
|
|
echo $subclass;
|
|
|
|
|
|
|
|
$task = new $subclass();
|
|
|
|
$task->process();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function process() {}
|
|
|
|
}
|
|
|
|
?>
|