コード例 #1
0
ファイル: PredisShared.php プロジェクト: rmoorman/web-bench
 private static function createConnection()
 {
     $serverProfile = Predis_RedisServerProfile::get('2.2');
     $connection = new Predis_Client(RC::getConnectionArguments(), $serverProfile);
     $connection->connect();
     $connection->select(RC::DEFAULT_DATABASE);
     return $connection;
 }
コード例 #2
0
ファイル: Predis.php プロジェクト: SallyU/yiicms
 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}");
 }
コード例 #3
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->assertInstanceOf($cmdClass, $profile->createCommand($cmdId));
 }