/** * Return a new instance of the Resque_Redis class instantiated for Resque. * * @return Resque_Redis Instance of Resque_Redis. */ public static function createRedis($server, $database, $password, $prefix) { self::$redis = new Resque_Redis($server, $database, $password); // Select Database self::$redis->select(self::$redisDatabase); Resque_Redis::prefix($prefix); return self::$redis; }
/** * Initializes the connection. */ public function init() { if (!class_exists('RResqueAutoloader', false)) { // Turn off our amazing library autoload spl_autoload_unregister(array('Yii', 'autoload')); // # Include Autoloader library // include(dirname(__FILE__) . '/RResqueAutoloader.php'); require_once dirname(__FILE__) . '/RResqueAutoloader.php'; // Run request autoloader RResqueAutoloader::register(); // Give back the power to Yii spl_autoload_register(array('Yii', 'autoload')); } Resque::setBackend($this->server . ':' . $this->port, $this->database, $this->password); if ($this->prefix) { Resque_Redis::prefix($this->prefix); } }