コード例 #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;
 }
コード例 #2
0
ファイル: Queues.php プロジェクト: cheggaaa/rediska-ko
 /**
  * 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;
 }
コード例 #3
0
ファイル: Set.php プロジェクト: utachkin/Rediska
 public function testFromArray()
 {
     $reply = $this->set->fromArray(array(123));
     $this->assertTrue($reply);
     $reply = $this->rediska->existsInSet('test', 123);
     $this->assertTrue($reply);
 }
コード例 #4
0
ファイル: Set.php プロジェクト: utachkin/Rediska
 /**
  * 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');
 }
コード例 #5
0
ファイル: SortedSetTest.php プロジェクト: r-kovalenko/Rediska
 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]);
 }
コード例 #6
0
ファイル: Followers.php プロジェクト: r-kovalenko/Rediska
 public function __construct($userId)
 {
     parent::__construct('user:'******':followers');
 }
コード例 #7
0
ファイル: UserPosts.php プロジェクト: r-kovalenko/Rediska
 public function __construct($userId)
 {
     parent::__construct('user:'******':posts');
 }
コード例 #8
0
ファイル: Redis.php プロジェクト: jahanzaibbahadur/twich
 /**
  * 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();
 }
コード例 #9
0
ファイル: play.php プロジェクト: kvz/eventcache
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();
コード例 #10
0
ファイル: Users.php プロジェクト: r-kovalenko/Rediska
 public function __construct()
 {
     parent::__construct('users');
 }