/** * 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()))); }
public function testServer() { $this->assertArrayHasKey('used_memory', $this->credis->info()); $this->assertArrayHasKey('maxmemory', $this->credis->config('GET', 'maxmemory')); }
public function testServer() { $this->assertTrue(array_key_exists('used_memory', $this->credis->info())); $this->assertTrue(array_key_exists('maxmemory', $this->credis->config('GET', 'maxmemory'))); }