/** * Returns the system worker frontend object * * todo: indicate a missing backend somehow * todo: be robust against missing pecl stuff * * @since 0.9.11 * @return Erfurt_Worker_Frontend */ public function getWorkerFrontend() { if (null === $this->_workerFrontend) { $bootstrap = $this->getBootstrap(); $workerFrontend = Erfurt_Worker_Frontend::getInstance(); $workerFrontend->setBackend('gearman'); $workerFrontend->setServers($bootstrap->config->worker->servers); $this->_workerFrontend = $workerFrontend; } return $this->_workerFrontend; }
/** * Returns singleton instance of registry. * @static * @access public * @return Erfurt_Worker_Frontend Singleton instance of worker frontend * @throws RuntimeException if worker is not configured * @throws RuntimeException if worker is not enabled */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }