2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
2008-02-25 03:10:37 +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() {
|
2008-08-12 04:51:33 +02:00
|
|
|
// Always re-compile the manifest (?flush=1)
|
|
|
|
ManifestBuilder::compileManifest();
|
|
|
|
|
2007-07-19 12:40:28 +02:00
|
|
|
foreach( ClassInfo::subclassesFor( $this->class ) as $subclass ) {
|
|
|
|
echo $subclass;
|
|
|
|
|
|
|
|
$task = new $subclass();
|
|
|
|
$task->process();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function process() {}
|
|
|
|
}
|
|
|
|
?>
|