function get_basic_sets($iterations = 1000) { $result = array(); for ($j = 0; $j < $this->set_iteration; $j++) { $set = new Rediska_Key_Set($this->set_variable . $j); $result[$j] = $set->getValues(); } return $result; }
/** * Get queues cache. Fetches data from redis on first call. * * @return array */ protected function _getQueuesCache() { if ($this->_queuesCache === null) { $this->_queuesCache = $this->_queuesSet->toArray(); } return $this->_queuesCache; }
public function testFromArray() { $reply = $this->set->fromArray(array(123)); $this->assertTrue($reply); $reply = $this->rediska->existsInSet('test', 123); $this->assertTrue($reply); }
/** * Session set constructor */ public function __construct() { if (!self::$_saveHandler) { throw new Rediska_Key_Exception('You must initialize Rediska_Zend_Session_SaveHandler_Redis before'); } $this->setRediska(self::getSaveHandler()->getRediska()); parent::__construct(self::getSaveHandler()->getOption('keyPrefix') . 'sessions'); }
public function testFromArray() { $reply = $this->set->fromArray(array(3 => 123)); $this->assertTrue($reply); $values = $this->rediska->getSortedSet('test'); $this->assertTrue(!empty($values)); $this->assertEquals(123, $values[0]); }
public function __construct($userId) { parent::__construct('user:'******':followers'); }
public function __construct($userId) { parent::__construct('user:'******':posts'); }
/** * Get an array of all available queues * * Not all adapters support getQueues(), use isSupported('getQueues') * to determine if the adapter supports this feature. * * @return array */ public function getQueues() { return $this->_queues->toArray(); }
error_reporting(E_ALL); function prd($arr) { echo "<xmp>"; if (is_array($arr) && count($arr)) { print_r($arr); } else { var_dump($arr); } echo "\n"; echo "</xmp>"; die; } include_once 'Rediska/Key/Set.php'; $key = 'test'; $Set = new Rediska_Key_Set($key); $Set->add('a'); $Set->add('b'); $Set->add('b'); $Set->add('a'); prd($Set->toArray()); die; require_once dirname(dirname(__FILE__)) . '/EventCache.php'; require_once dirname(dirname(__FILE__)) . '/EventCacheInst.php'; $E = new EventCacheInst(array('app' => 'testapp', 'trackEvents' => false, 'adapter' => 'EventCacheAdapterApc')); #$E->flush(); // //$E->delete('test'); //$lijst = $E->read('test'); //if (empty($lijst)) { // $lijst = array();
public function __construct() { parent::__construct('users'); }