Commit Graph

239 Commits

Author SHA1 Message Date
michael-grunder
6c37fa301d Merge branch 'feature/pubsub_cmd' into develop 2014-03-15 10:14:41 -07:00
michael-grunder
f200730fe9 _serialize method
This commit adds a utility method as a counterpart to the _unserialize
utility method, allowing users to manually serialize data themselves
before sending it to Redis.  This could be useful for calls going through
EVAL, as phpredis can't automatically serialize/unserialize in that case.

Addresses #431
2014-02-04 11:55:08 -08:00
michael-grunder
48ae8e52f6 Implement PUBSUB command
This commit implements the Redis PUBSUB command, a new command
available since Redis 2.8.0 and described here:
http://redis.io/commands/pubsub

Addresses #427
2014-01-21 14:50:34 -08:00
michael-grunder
1a89ec2ff4 Add Redis COPY and REPLACE flag support for Migrate command.
Addresses #426
2014-01-14 13:43:06 -08:00
michael-grunder
589072a649 Merge branch 'hotfix/incrbyfloat_docfix' into develop 2014-01-06 09:35:47 -08:00
liaolliso2012
f92b74ba35 Update README.markdown
incrByFloat function in example returns wrong value
2014-01-06 09:34:53 -08:00
Mithun Satheesh
727b824924 Update README.markdown
fixed syntax error in set examples.
2014-01-04 12:32:28 -08:00
Mithun Satheesh
3f0dcd8692 Update README.markdown
fixed syntax error in set examples.
2013-12-31 09:22:00 -08:00
Mathias Verraes
8732d89be9 added homebrew installation instructions 2013-12-23 08:32:27 -08:00
Nicolas Favre-Felix
a77439a7cf Minor documentation fixes 2013-12-14 21:00:06 +00:00
michael-grunder
84f3fb50b5 Another documentation fix :) 2013-12-14 11:01:51 -08:00
michael-grunder
2e4ff5711c Documentation fix 2013-12-14 11:00:37 -08:00
michael-grunder
ab553893f9 SCAN and variants
This commit introduces support for the Redis SCAN, HSCAN, SSCAN,
and ZSCAN commands.

In the case of HSCAN, SSCAN, and ZSCAN, we take a key and iterator
as required arguments, and for SCAN just an iterator.  Matching
the Redis commands, each variant can optionally take a pattern
to match against and a count value which hints at Redis how many
keys to return at a time.

When scanning keys or members (especially with a large keyspace when
searching for a pattern), Redis will sometimes return an empty result
of keys/members.  PHPRedis can be set up to abstract this from the
caller by setting:

$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);

Which instructs PHPRedis to keep retrying the scan until members are
returned OR the iteration completes (Redis returns to us a zero iterator).

By default this option is set to Redis::SCAN_NORETRY, meaning that
empty results are possible, requiring an explicit check for FALSE in the
scanning loop, like so:

```php
$it = NULL;
while(($arr_keys = $redis->scan($it, "*pattern*"))!==FALSE) {
	print_r($arr_keys);
}
```
2013-12-14 10:51:03 -08:00
michael-grunder
77afbe3dac Implement WAIT command
This commit implements the new WAIT command which currently lives
in redis unstable, along with a unit test.

Also added myself to the README.markdown file, as well as a link to
"the twitter".
2013-12-07 14:08:18 -08:00
michael-grunder
20a3ef42d8 Merge branch 'feature/mobli_ra_changes' into develop 2013-08-31 14:12:13 -07:00
michael-grunder
60e3ba781e Merge branch 'feature/new_set_args' into develop 2013-08-31 14:09:58 -07:00
michael-grunder
7207aae8aa Add SLOWLOG command
Add support for the various slowlog commands you can execute
in Redis, including:

SLOWLOG GET [len]
SLOWLOG RESET
SLOWLOG LIST
2013-08-27 21:26:51 -07:00
michael-grunder
8443769dc3 Merge remote-tracking branch 'mobli/develop' into feature/mobli_ra_changes
Conflicts:
	redis_array.c
	redis_array_impl.c
	redis_array_impl.h
2013-08-11 11:29:29 -07:00
michael-grunder
711f053b9f Redis >= 2.6.12 extended set options
Implement the new SET options as per the redis documentation:
http://redis.io/commands/set

You can now pass the new options (ex=>sec, px=>milisec, xx, nx) as
an array of options to the SET command and phpredis will handle them.

If you pass key, value, <long> phpredis will still redirect to SETEX
as it did before (to avoid breaking implementations).

Addresses #364
2013-08-02 23:31:27 -07:00
michael-grunder
1b624141c0 Update documentation and unit tests for TTL/PTTL
Addresses #358
2013-07-31 14:57:26 -07:00
Yuki Matsukura
5d1b3a4ddb Update README.markdown
- correct minor example mistake.
2013-04-27 22:06:41 +01:00
michael-grunder
e914485313 Merge branch 'hotfix/inspection_methods' into develop
Conflicts:
	php_redis.h
	redis.c
2013-03-27 11:21:02 -07:00
michael-grunder
ef792320e7 Introspection methods
This commit adds methods to get information about the state
of our phpredis object, such as what host/port we are connected
to, our timeout, etc...

The following methods have been added:

getHost()
getPort()
getDBNum()
getTimeout()
getReadTimeout()
isConnected()
getPersistentID()
getAuth()

In addition, there is a small memory leak fix when a persistent id
was specifically passed to connect() (it wasn't beeing freed).

Addresses issue #320
2013-03-27 10:21:18 -07:00
michael-grunder
7deb21fe2d More formatting 2013-02-25 14:12:20 -08:00
michael-grunder
b096f5771b Formatting fix 2013-02-25 14:10:53 -08:00
michael-grunder
5582166f77 Fix documentation for CLIENT command
Relates to issue #300
2013-02-25 14:08:07 -08:00
Emmanuel Merali
ec74ab98df Merge remote-tracking branch 'upstream/develop' into develop
Conflicts:
	library.c
	library.h
	redis.c
	redis_array.c
	redis_array_impl.c
	redis_array_impl.h
	redis_session.c
2013-02-25 00:54:48 +02:00
Emmanuel Merali
acd3245456 Added lazy_connect option to RedisArray
Added an option to let each RedisArray connection connect lazily to
their respective server. This is useful then working with a redis
cluster composed of many shards which are not necessarily in use all at
once.
2013-02-25 00:38:47 +02:00
Nicolas Favre-Felix
e4842cdeef Merge branch 'hotfix/document-windows-build' into develop 2013-02-17 15:31:23 +00:00
Nicolas Favre-Felix
df060ca2ce Link to instructions on how to build on Windows 2013-02-17 15:30:20 +00:00
Nicolas
c37a7d3610 Merge branch 'hotfix/document_session_on_unix_socket' into develop 2013-02-17 13:38:15 +00:00
Nicolas
507ba7c513 Document unix sockets with the session handler 2013-02-17 13:37:22 +00:00
michael-grunder
9a5196ed2e CLIENT Commands
This commit adds support for the CLIENT commands (list, getname,
setname, kill).

You can call them like so:

$redis->client('list');
$redis->client('getname');
$redis->client('setname', $name);
$redis->client('kill', $ip_port);

Solves issue #300
2013-02-16 17:57:32 -08:00
michael-grunder
242a16d50a Merge branch 'srandmember_count'
Conflicts:
	tests/TestRedis.php
2013-02-04 13:22:29 -08:00
michael-grunder
71a002d7fe Pulling README.markdown from master 2013-02-04 13:18:22 -08:00
michael-grunder
c1e7da4256 Fix markdown formatting 2013-02-04 13:13:00 -08:00
michael-grunder
87dddda2ab Update documentation to new format for our count argument 2013-02-04 13:10:48 -08:00
Tit Petric
fde191991e footer hr after keys toc 2012-11-27 16:21:58 +01:00
Tit Petric
dce8a704e3 Keys and strings toc import 2012-11-27 16:20:05 +01:00
Tit Petric
968d3fd8bc link keys and strings 2012-11-27 16:01:50 +01:00
Tit Petric
b99022893b llen fix, alias exists 2012-11-27 15:55:06 +01:00
Tit Petric
b8ee6128f3 lists and list toc 2012-11-27 15:47:32 +01:00
Tit Petric
0cf7c8813a transactions, pub/sub sections, toc 2012-11-27 15:28:10 +01:00
Tit Petric
328f599c38 moved hash methods under heading, created toc 2012-11-27 15:18:11 +01:00
Tit Petric
a6a51a9a48 scripting methods, created toc 2012-11-27 15:10:40 +01:00
Tit Petric
1c6ee3e2e8 alphabetized set methods, created toc 2012-11-27 15:02:01 +01:00
Tit Petric
3d055f8390 alphabetized sorted set methods, created toc 2012-11-27 14:43:56 +01:00
Tit Petric
3372eb988a server TOC and methods related to that 2012-11-27 14:17:55 +01:00
Tit Petric
1354cf9ed9 replaced html pre tags with markdown syntax 2012-11-27 13:51:53 +01:00
Tit Petric
dc6d4ddd8e testing, moved time and slaveof under server section, replace html code sections with markdown 2012-11-27 13:48:03 +01:00