Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public static function get($version)
 {
     if (!isset(self::$_serverProfiles)) {
         self::$_serverProfiles = self::predisServerProfiles();
     }
     if (!isset(self::$_serverProfiles[$version])) {
         throw new Predis_ClientException("Unknown server profile: {$version}");
     }
     $profile = self::$_serverProfiles[$version];
     return new $profile();
 }
Exemplo n.º 3
0
<?php

Predis_RedisServerProfile::registerProfile('Predis_RedisServer_v1_0', '1.0');
Predis_RedisServerProfile::registerProfile('Predis_RedisServer_v1_2_LongNames', '1.2');
Predis_RedisServerProfile::registerProfile('Predis_RedisServer_v2_0_LongNames', '2.0');
class Predis_RedisServer_v1_0 extends Predis_RedisServerProfile
{
    public function getVersion()
    {
        return '1.0';
    }
    public function getSupportedCommands()
    {
        return array('ping' => 'Predis_Compatibility_v1_0_Commands_Ping', 'echo' => 'Predis_Compatibility_v1_0_Commands_DoEcho', 'auth' => 'Predis_Compatibility_v1_0_Commands_Auth', 'quit' => 'Predis_Compatibility_v1_0_Commands_Quit', 'set' => 'Predis_Compatibility_v1_0_Commands_Set', 'setnx' => 'Predis_Compatibility_v1_0_Commands_SetPreserve', 'setPreserve' => 'Predis_Compatibility_v1_0_Commands_SetPreserve', 'get' => 'Predis_Compatibility_v1_0_Commands_Get', 'mget' => 'Predis_Compatibility_v1_0_Commands_GetMultiple', 'getMultiple' => 'Predis_Compatibility_v1_0_Commands_GetMultiple', 'getset' => 'Predis_Compatibility_v1_0_Commands_GetSet', 'getSet' => 'Predis_Compatibility_v1_0_Commands_GetSet', 'incr' => 'Predis_Compatibility_v1_0_Commands_Increment', 'increment' => 'Predis_Compatibility_v1_0_Commands_Increment', 'incrby' => 'Predis_Compatibility_v1_0_Commands_IncrementBy', 'incrementBy' => 'Predis_Compatibility_v1_0_Commands_IncrementBy', 'decr' => 'Predis_Compatibility_v1_0_Commands_Decrement', 'decrement' => 'Predis_Compatibility_v1_0_Commands_Decrement', 'decrby' => 'Predis_Compatibility_v1_0_Commands_DecrementBy', 'decrementBy' => 'Predis_Compatibility_v1_0_Commands_DecrementBy', 'exists' => 'Predis_Compatibility_v1_0_Commands_Exists', 'del' => 'Predis_Compatibility_v1_0_Commands_Delete', 'delete' => 'Predis_Compatibility_v1_0_Commands_Delete', 'type' => 'Predis_Compatibility_v1_0_Commands_Type', 'keys' => 'Predis_Compatibility_v1_0_Commands_Keys', 'randomkey' => 'Predis_Compatibility_v1_0_Commands_RandomKey', 'randomKey' => 'Predis_Compatibility_v1_0_Commands_RandomKey', 'rename' => 'Predis_Compatibility_v1_0_Commands_Rename', 'renamenx' => 'Predis_Compatibility_v1_0_Commands_RenamePreserve', 'renamePreserve' => 'Predis_Compatibility_v1_0_Commands_RenamePreserve', 'expire' => 'Predis_Compatibility_v1_0_Commands_Expire', 'expireat' => 'Predis_Compatibility_v1_0_Commands_ExpireAt', 'expireAt' => 'Predis_Compatibility_v1_0_Commands_ExpireAt', 'dbsize' => 'Predis_Compatibility_v1_0_Commands_DatabaseSize', 'databaseSize' => 'Predis_Compatibility_v1_0_Commands_DatabaseSize', 'ttl' => 'Predis_Compatibility_v1_0_Commands_TimeToLive', 'timeToLive' => 'Predis_Compatibility_v1_0_Commands_TimeToLive', 'rpush' => 'Predis_Compatibility_v1_0_Commands_ListPushTail', 'pushTail' => 'Predis_Compatibility_v1_0_Commands_ListPushTail', 'lpush' => 'Predis_Compatibility_v1_0_Commands_ListPushHead', 'pushHead' => 'Predis_Compatibility_v1_0_Commands_ListPushHead', 'llen' => 'Predis_Compatibility_v1_0_Commands_ListLength', 'listLength' => 'Predis_Compatibility_v1_0_Commands_ListLength', 'lrange' => 'Predis_Compatibility_v1_0_Commands_ListRange', 'listRange' => 'Predis_Compatibility_v1_0_Commands_ListRange', 'ltrim' => 'Predis_Compatibility_v1_0_Commands_ListTrim', 'listTrim' => 'Predis_Compatibility_v1_0_Commands_ListTrim', 'lindex' => 'Predis_Compatibility_v1_0_Commands_ListIndex', 'listIndex' => 'Predis_Compatibility_v1_0_Commands_ListIndex', 'lset' => 'Predis_Compatibility_v1_0_Commands_ListSet', 'listSet' => 'Predis_Compatibility_v1_0_Commands_ListSet', 'lrem' => 'Predis_Compatibility_v1_0_Commands_ListRemove', 'listRemove' => 'Predis_Compatibility_v1_0_Commands_ListRemove', 'lpop' => 'Predis_Compatibility_v1_0_Commands_ListPopFirst', 'popFirst' => 'Predis_Compatibility_v1_0_Commands_ListPopFirst', 'rpop' => 'Predis_Compatibility_v1_0_Commands_ListPopLast', 'popLast' => 'Predis_Compatibility_v1_0_Commands_ListPopLast', 'sadd' => 'Predis_Compatibility_v1_0_Commands_SetAdd', 'setAdd' => 'Predis_Compatibility_v1_0_Commands_SetAdd', 'srem' => 'Predis_Compatibility_v1_0_Commands_SetRemove', 'setRemove' => 'Predis_Compatibility_v1_0_Commands_SetRemove', 'spop' => 'Predis_Compatibility_v1_0_Commands_SetPop', 'setPop' => 'Predis_Compatibility_v1_0_Commands_SetPop', 'smove' => 'Predis_Compatibility_v1_0_Commands_SetMove', 'setMove' => 'Predis_Compatibility_v1_0_Commands_SetMove', 'scard' => 'Predis_Compatibility_v1_0_Commands_SetCardinality', 'setCardinality' => 'Predis_Compatibility_v1_0_Commands_SetCardinality', 'sismember' => 'Predis_Compatibility_v1_0_Commands_SetIsMember', 'setIsMember' => 'Predis_Compatibility_v1_0_Commands_SetIsMember', 'sinter' => 'Predis_Compatibility_v1_0_Commands_SetIntersection', 'setIntersection' => 'Predis_Compatibility_v1_0_Commands_SetIntersection', 'sinterstore' => 'Predis_Compatibility_v1_0_Commands_SetIntersectionStore', 'setIntersectionStore' => 'Predis_Compatibility_v1_0_Commands_SetIntersectionStore', 'sunion' => 'Predis_Compatibility_v1_0_Commands_SetUnion', 'setUnion' => 'Predis_Compatibility_v1_0_Commands_SetUnion', 'sunionstore' => 'Predis_Compatibility_v1_0_Commands_SetUnionStore', 'setUnionStore' => 'Predis_Compatibility_v1_0_Commands_SetUnionStore', 'sdiff' => 'Predis_Compatibility_v1_0_Commands_SetDifference', 'setDifference' => 'Predis_Compatibility_v1_0_Commands_SetDifference', 'sdiffstore' => 'Predis_Compatibility_v1_0_Commands_SetDifferenceStore', 'setDifferenceStore' => 'Predis_Compatibility_v1_0_Commands_SetDifferenceStore', 'smembers' => 'Predis_Compatibility_v1_0_Commands_SetMembers', 'setMembers' => 'Predis_Compatibility_v1_0_Commands_SetMembers', 'srandmember' => 'Predis_Compatibility_v1_0_Commands_SetRandomMember', 'setRandomMember' => 'Predis_Compatibility_v1_0_Commands_SetRandomMember', 'select' => 'Predis_Compatibility_v1_0_Commands_SelectDatabase', 'selectDatabase' => 'Predis_Compatibility_v1_0_Commands_SelectDatabase', 'move' => 'Predis_Compatibility_v1_0_Commands_MoveKey', 'moveKey' => 'Predis_Compatibility_v1_0_Commands_MoveKey', 'flushdb' => 'Predis_Compatibility_v1_0_Commands_FlushDatabase', 'flushDatabase' => 'Predis_Compatibility_v1_0_Commands_FlushDatabase', 'flushall' => 'Predis_Compatibility_v1_0_Commands_FlushAll', 'flushDatabases' => 'Predis_Compatibility_v1_0_Commands_FlushAll', 'sort' => 'Predis_Compatibility_v1_0_Commands_Sort', 'info' => 'Predis_Compatibility_v1_0_Commands_Info', 'slaveof' => 'Predis_Compatibility_v1_0_Commands_SlaveOf', 'slaveOf' => 'Predis_Compatibility_v1_0_Commands_SlaveOf', 'save' => 'Predis_Compatibility_v1_0_Commands_Save', 'bgsave' => 'Predis_Compatibility_v1_0_Commands_BackgroundSave', 'backgroundSave' => 'Predis_Compatibility_v1_0_Commands_BackgroundSave', 'lastsave' => 'Predis_Compatibility_v1_0_Commands_LastSave', 'lastSave' => 'Predis_Compatibility_v1_0_Commands_LastSave', 'shutdown' => 'Predis_Compatibility_v1_0_Commands_Shutdown');
    }
}
class Predis_RedisServer_v1_2_LongNames extends Predis_RedisServerProfile
{
    public function getVersion()
    {
        return '1.2';
    }
    public function getSupportedCommands()
    {
        return array('ping' => 'Predis_Commands_Ping', 'echo' => 'Predis_Commands_DoEcho', 'auth' => 'Predis_Commands_Auth', 'quit' => 'Predis_Commands_Quit', 'set' => 'Predis_Commands_Set', 'setnx' => 'Predis_Commands_SetPreserve', 'setPreserve' => 'Predis_Commands_SetPreserve', 'mset' => 'Predis_Commands_SetMultiple', 'setMultiple' => 'Predis_Commands_SetMultiple', 'msetnx' => 'Predis_Commands_SetMultiplePreserve', 'setMultiplePreserve' => 'Predis_Commands_SetMultiplePreserve', 'get' => 'Predis_Commands_Get', 'mget' => 'Predis_Commands_GetMultiple', 'getMultiple' => 'Predis_Commands_GetMultiple', 'getset' => 'Predis_Commands_GetSet', 'getSet' => 'Predis_Commands_GetSet', 'incr' => 'Predis_Commands_Increment', 'increment' => 'Predis_Commands_Increment', 'incrby' => 'Predis_Commands_IncrementBy', 'incrementBy' => 'Predis_Commands_IncrementBy', 'decr' => 'Predis_Commands_Decrement', 'decrement' => 'Predis_Commands_Decrement', 'decrby' => 'Predis_Commands_DecrementBy', 'decrementBy' => 'Predis_Commands_DecrementBy', 'exists' => 'Predis_Commands_Exists', 'del' => 'Predis_Commands_Delete', 'delete' => 'Predis_Commands_Delete', 'type' => 'Predis_Commands_Type', 'keys' => 'Predis_Commands_Keys_v1_2', 'randomkey' => 'Predis_Commands_RandomKey', 'randomKey' => 'Predis_Commands_RandomKey', 'rename' => 'Predis_Commands_Rename', 'renamenx' => 'Predis_Commands_RenamePreserve', 'renamePreserve' => 'Predis_Commands_RenamePreserve', 'expire' => 'Predis_Commands_Expire', 'expireat' => 'Predis_Commands_ExpireAt', 'expireAt' => 'Predis_Commands_ExpireAt', 'dbsize' => 'Predis_Commands_DatabaseSize', 'databaseSize' => 'Predis_Commands_DatabaseSize', 'ttl' => 'Predis_Commands_TimeToLive', 'timeToLive' => 'Predis_Commands_TimeToLive', 'rpush' => 'Predis_Commands_ListPushTail', 'pushTail' => 'Predis_Commands_ListPushTail', 'lpush' => 'Predis_Commands_ListPushHead', 'pushHead' => 'Predis_Commands_ListPushHead', 'llen' => 'Predis_Commands_ListLength', 'listLength' => 'Predis_Commands_ListLength', 'lrange' => 'Predis_Commands_ListRange', 'listRange' => 'Predis_Commands_ListRange', 'ltrim' => 'Predis_Commands_ListTrim', 'listTrim' => 'Predis_Commands_ListTrim', 'lindex' => 'Predis_Commands_ListIndex', 'listIndex' => 'Predis_Commands_ListIndex', 'lset' => 'Predis_Commands_ListSet', 'listSet' => 'Predis_Commands_ListSet', 'lrem' => 'Predis_Commands_ListRemove', 'listRemove' => 'Predis_Commands_ListRemove', 'lpop' => 'Predis_Commands_ListPopFirst', 'popFirst' => 'Predis_Commands_ListPopFirst', 'rpop' => 'Predis_Commands_ListPopLast', 'popLast' => 'Predis_Commands_ListPopLast', 'rpoplpush' => 'Predis_Commands_ListPopLastPushHead', 'listPopLastPushHead' => 'Predis_Commands_ListPopLastPushHead', 'sadd' => 'Predis_Commands_SetAdd', 'setAdd' => 'Predis_Commands_SetAdd', 'srem' => 'Predis_Commands_SetRemove', 'setRemove' => 'Predis_Commands_SetRemove', 'spop' => 'Predis_Commands_SetPop', 'setPop' => 'Predis_Commands_SetPop', 'smove' => 'Predis_Commands_SetMove', 'setMove' => 'Predis_Commands_SetMove', 'scard' => 'Predis_Commands_SetCardinality', 'setCardinality' => 'Predis_Commands_SetCardinality', 'sismember' => 'Predis_Commands_SetIsMember', 'setIsMember' => 'Predis_Commands_SetIsMember', 'sinter' => 'Predis_Commands_SetIntersection', 'setIntersection' => 'Predis_Commands_SetIntersection', 'sinterstore' => 'Predis_Commands_SetIntersectionStore', 'setIntersectionStore' => 'Predis_Commands_SetIntersectionStore', 'sunion' => 'Predis_Commands_SetUnion', 'setUnion' => 'Predis_Commands_SetUnion', 'sunionstore' => 'Predis_Commands_SetUnionStore', 'setUnionStore' => 'Predis_Commands_SetUnionStore', 'sdiff' => 'Predis_Commands_SetDifference', 'setDifference' => 'Predis_Commands_SetDifference', 'sdiffstore' => 'Predis_Commands_SetDifferenceStore', 'setDifferenceStore' => 'Predis_Commands_SetDifferenceStore', 'smembers' => 'Predis_Commands_SetMembers', 'setMembers' => 'Predis_Commands_SetMembers', 'srandmember' => 'Predis_Commands_SetRandomMember', 'setRandomMember' => 'Predis_Commands_SetRandomMember', 'zadd' => 'Predis_Commands_ZSetAdd', 'zsetAdd' => 'Predis_Commands_ZSetAdd', 'zincrby' => 'Predis_Commands_ZSetIncrementBy', 'zsetIncrementBy' => 'Predis_Commands_ZSetIncrementBy', 'zrem' => 'Predis_Commands_ZSetRemove', 'zsetRemove' => 'Predis_Commands_ZSetRemove', 'zrange' => 'Predis_Commands_ZSetRange', 'zsetRange' => 'Predis_Commands_ZSetRange', 'zrevrange' => 'Predis_Commands_ZSetReverseRange', 'zsetReverseRange' => 'Predis_Commands_ZSetReverseRange', 'zrangebyscore' => 'Predis_Commands_ZSetRangeByScore', 'zsetRangeByScore' => 'Predis_Commands_ZSetRangeByScore', 'zcard' => 'Predis_Commands_ZSetCardinality', 'zsetCardinality' => 'Predis_Commands_ZSetCardinality', 'zscore' => 'Predis_Commands_ZSetScore', 'zsetScore' => 'Predis_Commands_ZSetScore', 'zremrangebyscore' => 'Predis_Commands_ZSetRemoveRangeByScore', 'zsetRemoveRangeByScore' => 'Predis_Commands_ZSetRemoveRangeByScore', 'select' => 'Predis_Commands_SelectDatabase', 'selectDatabase' => 'Predis_Commands_SelectDatabase', 'move' => 'Predis_Commands_MoveKey', 'moveKey' => 'Predis_Commands_MoveKey', 'flushdb' => 'Predis_Commands_FlushDatabase', 'flushDatabase' => 'Predis_Commands_FlushDatabase', 'flushall' => 'Predis_Commands_FlushAll', 'flushDatabases' => 'Predis_Commands_FlushAll', 'sort' => 'Predis_Commands_Sort', 'info' => 'Predis_Commands_Info', 'slaveof' => 'Predis_Commands_SlaveOf', 'slaveOf' => 'Predis_Commands_SlaveOf', 'save' => 'Predis_Commands_Save', 'bgsave' => 'Predis_Commands_BackgroundSave', 'backgroundSave' => 'Predis_Commands_BackgroundSave', 'lastsave' => 'Predis_Commands_LastSave', 'lastSave' => 'Predis_Commands_LastSave', 'shutdown' => 'Predis_Commands_Shutdown', 'bgrewriteaof' => 'Predis_Commands_BackgroundRewriteAppendOnlyFile', 'backgroundRewriteAppendOnlyFile' => 'Predis_Commands_BackgroundRewriteAppendOnlyFile');
    }
}
class Predis_RedisServer_v2_0_LongNames extends Predis_RedisServer_v1_2_LongNames
{
    public function getVersion()
    {
Exemplo n.º 4
0
<?php

Predis_RedisServerProfile::registerProfile('Predis_RedisServer_v1_0', '1.0');
class Predis_RedisServer_v1_0 extends Predis_RedisServerProfile
{
    public function getVersion()
    {
        return '1.0';
    }
    public function getSupportedCommands()
    {
        return array('ping' => 'Predis_Compatibility_v1_0_Commands_Ping', 'echo' => 'Predis_Compatibility_v1_0_Commands_DoEcho', 'auth' => 'Predis_Compatibility_v1_0_Commands_Auth', 'quit' => 'Predis_Compatibility_v1_0_Commands_Quit', 'set' => 'Predis_Compatibility_v1_0_Commands_Set', 'setnx' => 'Predis_Compatibility_v1_0_Commands_SetPreserve', 'setPreserve' => 'Predis_Compatibility_v1_0_Commands_SetPreserve', 'get' => 'Predis_Compatibility_v1_0_Commands_Get', 'mget' => 'Predis_Compatibility_v1_0_Commands_GetMultiple', 'getMultiple' => 'Predis_Compatibility_v1_0_Commands_GetMultiple', 'getset' => 'Predis_Compatibility_v1_0_Commands_GetSet', 'getSet' => 'Predis_Compatibility_v1_0_Commands_GetSet', 'incr' => 'Predis_Compatibility_v1_0_Commands_Increment', 'increment' => 'Predis_Compatibility_v1_0_Commands_Increment', 'incrby' => 'Predis_Compatibility_v1_0_Commands_IncrementBy', 'incrementBy' => 'Predis_Compatibility_v1_0_Commands_IncrementBy', 'decr' => 'Predis_Compatibility_v1_0_Commands_Decrement', 'decrement' => 'Predis_Compatibility_v1_0_Commands_Decrement', 'decrby' => 'Predis_Compatibility_v1_0_Commands_DecrementBy', 'decrementBy' => 'Predis_Compatibility_v1_0_Commands_DecrementBy', 'exists' => 'Predis_Compatibility_v1_0_Commands_Exists', 'del' => 'Predis_Compatibility_v1_0_Commands_Delete', 'delete' => 'Predis_Compatibility_v1_0_Commands_Delete', 'type' => 'Predis_Compatibility_v1_0_Commands_Type', 'keys' => 'Predis_Compatibility_v1_0_Commands_Keys', 'randomkey' => 'Predis_Compatibility_v1_0_Commands_RandomKey', 'randomKey' => 'Predis_Compatibility_v1_0_Commands_RandomKey', 'rename' => 'Predis_Compatibility_v1_0_Commands_Rename', 'renamenx' => 'Predis_Compatibility_v1_0_Commands_RenamePreserve', 'renamePreserve' => 'Predis_Compatibility_v1_0_Commands_RenamePreserve', 'expire' => 'Predis_Compatibility_v1_0_Commands_Expire', 'expireat' => 'Predis_Compatibility_v1_0_Commands_ExpireAt', 'expireAt' => 'Predis_Compatibility_v1_0_Commands_ExpireAt', 'dbsize' => 'Predis_Compatibility_v1_0_Commands_DatabaseSize', 'databaseSize' => 'Predis_Compatibility_v1_0_Commands_DatabaseSize', 'ttl' => 'Predis_Compatibility_v1_0_Commands_TimeToLive', 'timeToLive' => 'Predis_Compatibility_v1_0_Commands_TimeToLive', 'rpush' => 'Predis_Compatibility_v1_0_Commands_ListPushTail', 'pushTail' => 'Predis_Compatibility_v1_0_Commands_ListPushTail', 'lpush' => 'Predis_Compatibility_v1_0_Commands_ListPushHead', 'pushHead' => 'Predis_Compatibility_v1_0_Commands_ListPushHead', 'llen' => 'Predis_Compatibility_v1_0_Commands_ListLength', 'listLength' => 'Predis_Compatibility_v1_0_Commands_ListLength', 'lrange' => 'Predis_Compatibility_v1_0_Commands_ListRange', 'listRange' => 'Predis_Compatibility_v1_0_Commands_ListRange', 'ltrim' => 'Predis_Compatibility_v1_0_Commands_ListTrim', 'listTrim' => 'Predis_Compatibility_v1_0_Commands_ListTrim', 'lindex' => 'Predis_Compatibility_v1_0_Commands_ListIndex', 'listIndex' => 'Predis_Compatibility_v1_0_Commands_ListIndex', 'lset' => 'Predis_Compatibility_v1_0_Commands_ListSet', 'listSet' => 'Predis_Compatibility_v1_0_Commands_ListSet', 'lrem' => 'Predis_Compatibility_v1_0_Commands_ListRemove', 'listRemove' => 'Predis_Compatibility_v1_0_Commands_ListRemove', 'lpop' => 'Predis_Compatibility_v1_0_Commands_ListPopFirst', 'popFirst' => 'Predis_Compatibility_v1_0_Commands_ListPopFirst', 'rpop' => 'Predis_Compatibility_v1_0_Commands_ListPopLast', 'popLast' => 'Predis_Compatibility_v1_0_Commands_ListPopLast', 'sadd' => 'Predis_Compatibility_v1_0_Commands_SetAdd', 'setAdd' => 'Predis_Compatibility_v1_0_Commands_SetAdd', 'srem' => 'Predis_Compatibility_v1_0_Commands_SetRemove', 'setRemove' => 'Predis_Compatibility_v1_0_Commands_SetRemove', 'spop' => 'Predis_Compatibility_v1_0_Commands_SetPop', 'setPop' => 'Predis_Compatibility_v1_0_Commands_SetPop', 'smove' => 'Predis_Compatibility_v1_0_Commands_SetMove', 'setMove' => 'Predis_Compatibility_v1_0_Commands_SetMove', 'scard' => 'Predis_Compatibility_v1_0_Commands_SetCardinality', 'setCardinality' => 'Predis_Compatibility_v1_0_Commands_SetCardinality', 'sismember' => 'Predis_Compatibility_v1_0_Commands_SetIsMember', 'setIsMember' => 'Predis_Compatibility_v1_0_Commands_SetIsMember', 'sinter' => 'Predis_Compatibility_v1_0_Commands_SetIntersection', 'setIntersection' => 'Predis_Compatibility_v1_0_Commands_SetIntersection', 'sinterstore' => 'Predis_Compatibility_v1_0_Commands_SetIntersectionStore', 'setIntersectionStore' => 'Predis_Compatibility_v1_0_Commands_SetIntersectionStore', 'sunion' => 'Predis_Compatibility_v1_0_Commands_SetUnion', 'setUnion' => 'Predis_Compatibility_v1_0_Commands_SetUnion', 'sunionstore' => 'Predis_Compatibility_v1_0_Commands_SetUnionStore', 'setUnionStore' => 'Predis_Compatibility_v1_0_Commands_SetUnionStore', 'sdiff' => 'Predis_Compatibility_v1_0_Commands_SetDifference', 'setDifference' => 'Predis_Compatibility_v1_0_Commands_SetDifference', 'sdiffstore' => 'Predis_Compatibility_v1_0_Commands_SetDifferenceStore', 'setDifferenceStore' => 'Predis_Compatibility_v1_0_Commands_SetDifferenceStore', 'smembers' => 'Predis_Compatibility_v1_0_Commands_SetMembers', 'setMembers' => 'Predis_Compatibility_v1_0_Commands_SetMembers', 'srandmember' => 'Predis_Compatibility_v1_0_Commands_SetRandomMember', 'setRandomMember' => 'Predis_Compatibility_v1_0_Commands_SetRandomMember', 'select' => 'Predis_Compatibility_v1_0_Commands_SelectDatabase', 'selectDatabase' => 'Predis_Compatibility_v1_0_Commands_SelectDatabase', 'move' => 'Predis_Compatibility_v1_0_Commands_MoveKey', 'moveKey' => 'Predis_Compatibility_v1_0_Commands_MoveKey', 'flushdb' => 'Predis_Compatibility_v1_0_Commands_FlushDatabase', 'flushDatabase' => 'Predis_Compatibility_v1_0_Commands_FlushDatabase', 'flushall' => 'Predis_Compatibility_v1_0_Commands_FlushAll', 'flushDatabases' => 'Predis_Compatibility_v1_0_Commands_FlushAll', 'sort' => 'Predis_Compatibility_v1_0_Commands_Sort', 'info' => 'Predis_Compatibility_v1_0_Commands_Info', 'slaveof' => 'Predis_Compatibility_v1_0_Commands_SlaveOf', 'slaveOf' => 'Predis_Compatibility_v1_0_Commands_SlaveOf', 'save' => 'Predis_Compatibility_v1_0_Commands_Save', 'bgsave' => 'Predis_Compatibility_v1_0_Commands_BackgroundSave', 'backgroundSave' => 'Predis_Compatibility_v1_0_Commands_BackgroundSave', 'lastsave' => 'Predis_Compatibility_v1_0_Commands_LastSave', 'lastSave' => 'Predis_Compatibility_v1_0_Commands_LastSave', 'shutdown' => 'Predis_Compatibility_v1_0_Commands_Shutdown');
    }
}
/* ------------------------------------------------------------------------- */
/* miscellaneous commands */
class Predis_Compatibility_v1_0_Commands_Ping extends Predis_InlineCommand
{
    public function canBeHashed()
    {
        return false;
    }
    public function getCommandId()
    {
        return 'PING';
    }
    public function parseResponse($data)
    {
        return $data === 'PONG' ? true : false;
    }
}
Exemplo n.º 5
0
 function testConnection_ReadTimeout()
 {
     $timeout = 1;
     $args = array_merge(RC::getConnectionArguments(), array('read_write_timeout' => $timeout));
     $cmdFake = Predis_RedisServerProfile::getDefault()->createCommand('ping');
     $connection = new Predis_Connection(new Predis_ConnectionParameters($args));
     $expectedMessage = 'Error while reading line from the server';
     $start = time();
     $thrownException = null;
     try {
         $connection->readResponse($cmdFake);
     } catch (Predis_CommunicationException $exception) {
         $thrownException = $exception;
     }
     $this->assertInstanceOf('Predis_CommunicationException', $thrownException);
     $this->assertEquals($expectedMessage, $thrownException->getMessage());
     $this->assertEquals((double) (time() - $start), $timeout, '', 1);
 }