Example #1
0
 /**
  * Get databases that exist in Redis instance
  * 
  * @param  Credis_Client|Redis $redis
  * @return array
  */
 public static function getDatabases($redis)
 {
     return array_map(function ($db) {
         return (int) substr($db, 2);
     }, preg_grep("/^db[0-9]+\$/", array_keys($redis->info())));
 }
Example #2
0
 public function testServer()
 {
     $this->assertArrayHasKey('used_memory', $this->credis->info());
     $this->assertArrayHasKey('maxmemory', $this->credis->config('GET', 'maxmemory'));
 }
Example #3
0
 public function testServer()
 {
     $this->assertTrue(array_key_exists('used_memory', $this->credis->info()));
     $this->assertTrue(array_key_exists('maxmemory', $this->credis->config('GET', 'maxmemory')));
 }