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)
|
2008-10-08 04:00:12 +02:00
|
|
|
ManifestBuilder::update_db_tables(DB::getConn()->tableList(), $_ALL_CLASSES);
|
|
|
|
ManifestBuilder::write_manifest();
|
2008-08-12 04:51:33 +02:00
|
|
|
|
2007-07-19 12:40:28 +02:00
|
|
|
foreach( ClassInfo::subclassesFor( $this->class ) as $subclass ) {
|
|
|
|
echo $subclass;
|
|
|
|
|
|
|
|
$task = new $subclass();
|
|
|
|
$task->process();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function process() {}
|
|
|
|
}
|
|
|
|
?>
|