Beispiel #1
0
 public function validate($option, $value)
 {
     if ($value instanceof \Predis\RedisServerProfile) {
         return $value;
     }
     if (is_string($value)) {
         return \Predis\RedisServerProfile::get($value);
     }
     throw new \InvalidArgumentException("Invalid value for option {$option}");
 }
Beispiel #2
0
 function testRedisServerProfile_CommandsRegistration()
 {
     $profile = \Predis\RedisServerProfile::get('1.0');
     $cmdId = 'mset';
     $cmdClass = '\\Predis\\Commands\\SetMultiple';
     $this->assertFalse($profile->supportsCommand($cmdId));
     $profile->registerCommand(new $cmdClass(), $cmdId);
     $this->assertTrue($profile->supportsCommand($cmdId));
     $this->assertType($cmdClass, $profile->createCommand($cmdId));
 }