diff --git a/TODO b/TODO index 51ae1023..0402d11c 100644 --- a/TODO +++ b/TODO @@ -13,4 +13,5 @@ * Missing tests for commands: PUBLISH, SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, DEBUG, OBJECT, - CLIENT, CONFIG GET, CONFIG SET, CONFIG RESETSTAT, SLOWLOG, SCRIPT + CLIENT, CONFIG GET, CONFIG SET, CONFIG RESETSTAT, SLOWLOG, SCRIPT, PTTL, + PSETEX, PEXPIRE, PEXPIREAT diff --git a/lib/Predis/Commands/KeyPreciseExpire.php b/lib/Predis/Commands/KeyPreciseExpire.php new file mode 100644 index 00000000..a3916842 --- /dev/null +++ b/lib/Predis/Commands/KeyPreciseExpire.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Commands; + +/** + * @link http://redis.io/commands/pexpire + * @author Daniele Alessandri + */ +class KeyPreciseExpire extends KeyExpire +{ + /** + * {@inheritdoc} + */ + public function getId() + { + return 'PEXPIRE'; + } +} diff --git a/lib/Predis/Commands/KeyPreciseExpireAt.php b/lib/Predis/Commands/KeyPreciseExpireAt.php new file mode 100644 index 00000000..ef270675 --- /dev/null +++ b/lib/Predis/Commands/KeyPreciseExpireAt.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Commands; + +/** + * @link http://redis.io/commands/pexpireat + * @author Daniele Alessandri + */ +class KeyPreciseExpireAt extends KeyExpireAt +{ + /** + * {@inheritdoc} + */ + public function getId() + { + return 'PEXPIREAT'; + } +} diff --git a/lib/Predis/Commands/KeyPreciseTimeToLive.php b/lib/Predis/Commands/KeyPreciseTimeToLive.php new file mode 100644 index 00000000..70413fc7 --- /dev/null +++ b/lib/Predis/Commands/KeyPreciseTimeToLive.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Commands; + +/** + * @link http://redis.io/commands/pttl + * @author Daniele Alessandri + */ +class KeyPreciseTimeToLive extends KeyTimeToLive +{ + /** + * {@inheritdoc} + */ + public function getId() + { + return 'PTTL'; + } +} diff --git a/lib/Predis/Commands/StringPreciseSetExpire.php b/lib/Predis/Commands/StringPreciseSetExpire.php new file mode 100644 index 00000000..ad6211d8 --- /dev/null +++ b/lib/Predis/Commands/StringPreciseSetExpire.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Commands; + +/** + * @link http://redis.io/commands/psetex + * @author Daniele Alessandri + */ +class StringPreciseSetExpire extends StringSetExpire +{ + /** + * {@inheritdoc} + */ + public function getId() + { + return 'PSETEX'; + } +} diff --git a/lib/Predis/Profiles/ServerVersionNext.php b/lib/Predis/Profiles/ServerVersionNext.php index d2803875..317c58e1 100644 --- a/lib/Predis/Profiles/ServerVersionNext.php +++ b/lib/Predis/Profiles/ServerVersionNext.php @@ -32,10 +32,21 @@ class ServerVersionNext extends ServerVersion24 public function getSupportedCommands() { return array_merge(parent::getSupportedCommands(), array( - 'info' => '\Predis\Commands\ServerInfoV26x', + /* commands operating on the key space */ + 'pttl' => '\Predis\Commands\KeyPreciseTimeToLive', + 'pexpire' => '\Predis\Commands\KeyPreciseExpire', + 'pexpireat' => '\Predis\Commands\KeyPreciseExpireAt', + + /* commands operating on string values */ + 'psetex' => '\Predis\Commands\StringPreciseSetExpire', + + /* scripting */ 'eval' => '\Predis\Commands\ServerEval', 'evalsha' => '\Predis\Commands\ServerEvalSHA', 'script' => '\Predis\Commands\ServerScript', + + /* remote server control commands */ + 'info' => '\Predis\Commands\ServerInfoV26x', )); } }