/** * @static * @return Pheanstalk object */ public static function getInstance() { if (self::$conn == null) { self::$conn = new Pheanstalk(sprintf('%s:%s', sfConfig::get('app_pheanstalk_host', '127.0.0.1'), sfConfig::get('app_pheanstalk_port', 11300))); } return self::$conn; }
public static function getInstance() { $host = sfConfig::get('app_pheanstalk_host', '127.0.0.1'); $port = sfConfig::get('app_pheanstalk_port', 11300); $path = sfConfig::get('app_pheanstalk_path', realpath(dirname(__FILE__) . '/../vendor')) . '/pheanstalk_init.php'; require_once $path; if (self::$conn == null) { self::$conn = new Pheanstalk($host . ':' . $port); } return self::$conn; }
/** * Construct a new majaxPheanstalkWorkerThread * * @param string $path */ public function __construct($path, sfTask $task = null) { $this->setBasePath($path); $this->log('starting'); $this->doConstruct(); if ($task instanceof sfTask) { $this->task = $task; } if ($this->enable_pheanstalk) { $this->pheanstalk = majaxPheanstalk::getInstance(); } }
protected function execute($arguments = array(), $options = array()) { foreach (majaxPheanstalk::getInstance()->listTubes() as $idx => $tube) { $this->logSection(++$idx, $tube); } }
protected function execute($arguments = array(), $options = array()) { foreach (majaxPheanstalk::getInstance()->stats() as $name => $val) { $this->logSection($name, $val); } }