Use the lengths for our optional parameters, as NULL will
come through as a non null zval pointer with a zero length
Properly return the length from the redis_cmd_sstr_init function
This commit changes how we build the Redis protocol string for
ZUNIONSTORE and ZINTERSTORE such that we avoid reallocating
memory for the command buffer for each new key or weight
I accidentally pulled this when getting some of the pull requests
integrated (git flow style) for this release. I like the idea
for sure, but I think it needs more detailed documentation and
further testing.
At the very least, I need to understand it :)
This commit changes the way we construct the MGET command
such that we avoid allocating and reallocating the command
string pointer for every new key that is added.
This means that MGET performance scales in a linear way rather
than exponentially.
When using the TTL command, Redis >= 2.8 will return -1 for a key
with no TTL and -2 for a key that doesn't exist. This fixes the
unit tests so they don't expect this in versions < 2.8.
When calling php library methods to convert doubles to strings
we were only keeping 8 digits after the decimal point. For
double precision numbers, 15 are stable.
Redis uses the C library function strtod() to do the conversion,
which appears to use the first 16 digits for aproximation:
http://www.exploringbinary.com/how-strtod-works-and-sometimes-doesnt/
This hotfix increases the signifigant digits to 16, which I think
is the correct number to pick here.
Addresses issue #371
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
When Redis::(p)connect() is called on a newly created Redis instance that will always cause an exception to be thrown. The connect code will actually try and cancel the
exception but this is problematic when you are using tools like APM (pecl.php.net/apm) which hook into the exception handler: it will already have handled it. This change simply stops the connect from throwing exceptions for that situation.