#!/usr/bin/php * @license PHP License * @package WB * @subpackage Wikipedia */ $base = realpath( dirname( __FILE__ ) . '/..' ); include $base . '/wbLoader.php'; WBClass::load('WBObserver'); class WBCli extends WBStdClass { /** * Command line arguments * @var array */ protected $arguments = array(); final public function __construct() { // init CLI arguments $this->init(); } /** * 2nd constructor * */ public function init() { } final public function run() { $params = array(); $this->execute($params); } protected function execute($params) { } } class WBCli_EventQueueProcessor extends WBCli implements WBObserver { /** * event processor * @var WBEvent_Processor */ protected $proc; public function init() { $this->proc = WBClass::create('WBEvent_Processor'); } protected function execute($params) { $this->proc->attach($this); $this->proc->executeAll(); $this->proc->detach($this); echo "done\n"; return 0; } public function update($proc) { if ($this->proc->getPosition() == 1) { echo "process: " . $this->proc->getCount() . ' '; } echo '.'; } } $eqp = new WBCli_EventQueueProcessor(); $eqp->run(); ?>