Example #1
0
 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;
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 public function testFromArray()
 {
     $reply = $this->set->fromArray(array(123));
     $this->assertTrue($reply);
     $reply = $this->rediska->existsInSet('test', 123);
     $this->assertTrue($reply);
 }
Example #4
0
 /**
  * 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');
 }
Example #5
0
 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]);
 }
Example #6
0
 public function __construct($userId)
 {
     parent::__construct('user:'******':followers');
 }
Example #7
0
 public function __construct($userId)
 {
     parent::__construct('user:'******':posts');
 }
Example #8
0
 /**
  * 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();
 }
Example #9
0
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();
Example #10
0
 public function __construct()
 {
     parent::__construct('users');
 }