Skip to content

Commit

Permalink
Add PEXPIREAT.
Browse files Browse the repository at this point in the history
Fixes GitHub issue #147.
  • Loading branch information
nicolasff committed Apr 29, 2012
1 parent 7bff3dd commit 261c573
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,9 @@ sleep(5); // wait 5 seconds
$redis->get('x'); // will return `FALSE`, as 'x' has expired.
</pre>

## expireAt
## expireAt, pexpireAt
##### *Description*
Sets an expiration date (a timestamp) on an item.
Sets an expiration date (a timestamp) on an item. pexpireAt requires a timestamp in milliseconds.

##### *Parameters*
*Key*: key. The key that will disappear.
Expand Down
1 change: 1 addition & 0 deletions php_redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ PHP_METHOD(Redis, zIncrBy);
PHP_METHOD(Redis, zInter);
PHP_METHOD(Redis, zUnion);
PHP_METHOD(Redis, expireAt);
PHP_METHOD(Redis, pexpireAt);
PHP_METHOD(Redis, bgrewriteaof);
PHP_METHOD(Redis, slaveof);
PHP_METHOD(Redis, object);
Expand Down
8 changes: 8 additions & 0 deletions redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ static zend_function_entry redis_functions[] = {
PHP_ME(Redis, zUnion, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, zIncrBy, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, expireAt, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, pexpireAt, NULL, ZEND_ACC_PUBLIC)

/* 1.2 */
PHP_ME(Redis, hGet, NULL, ZEND_ACC_PUBLIC)
Expand Down Expand Up @@ -2879,6 +2880,13 @@ PHP_METHOD(Redis, expireAt) {
}
/* }}} */

/* {{{ proto array Redis::pexpireAt(string key, int timestamp)
*/
PHP_METHOD(Redis, pexpireAt) {
generic_expire_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "PEXPIREAT", sizeof("PEXPIREAT")-1);
}
/* }}} */


/* {{{ proto array Redis::lSet(string key, int index, string value)
*/
Expand Down

0 comments on commit 261c573

Please sign in to comment.