/** * Resets this object to its initial state. * * @return void */ public static function reset() { self::resetDefault(); self::$instances = array(); }
/** * Run the job */ public function run($classes = NULL) { static $job; if (!$job) { $queue = ymcJobQueueInstance::get(); $job = $queue->pop($classes ? $classes : array()); if (!$job) { return FALSE; } } try { $result = $job->run(); } catch (Exception $e) { // Jobs throwing exceptions will be deleted! ezcLog::getInstance()->log('Exception while running job ' . $e, ezcLog::ERROR); $queue = ymcJobQueueInstance::get(); $queue->cancel($job); $job = NULL; return TRUE; } // Done with this job! if (!$result) { $queue = ymcJobQueueInstance::get(); $queue->done($job); $job->clean(); $job = NULL; } elseif ($job->needsUpdate()) { $this->update($job); } return TRUE; }