phpredis
Repos
2

Events

Created at 4 hours ago
Created at 4 hours ago
Created at 11 hours ago
pull request opened
BLPOP with a float timeout

See #2157

Created at 1 day ago

BLPOP with a float timeout

See #2157

Created at 1 day ago
Created at 1 day ago
Created at 1 day ago

BLPOP with a float timeout

See #2157

Created at 2 days ago

Update tests, fix BZPOPMIN/MAX logic

See #2157

Created at 3 days ago

Add a test when running against Redis >= 6.0.0

See #2157

Created at 3 days ago
create branch
michael-grunder create branch issue.2157-float-brpop-timeout
Created at 3 days ago
closed issue
Unable to load dynamic library 'redis.so' on php8.1 with igbinary

Expected behaviour

Actual behaviour

I'm seeing this behaviour on

  • OS: Mac OS 12.1
  • Redis:6.2.6
  • PHP:8.1
  • phpredis:5.3.5

$ pecl install igbinary // 3.2.7 $ pecl install zstd $ pecl install redis

Steps to reproduce, backtrace or example script

[13-Jan-2022 20:34:31] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/lib/php/pecl/20210902/redis.so (dlopen(/usr/local/lib/php/pecl/20210902/redis.so, 0x0009): symbol not found in flat namespace '_igbinary_serialize'), /usr/local/lib/php/pecl/20210902/redis.so.so (dlopen(/usr/local/lib/php/pecl/20210902/redis.so.so, 0x0009): tried: '/usr/local/lib/php/pecl/20210902/redis.so.so' (no such file), '/usr/local/lib/redis.so.so' (no such file), '/usr/lib/redis.so.so' (no such file))) in Unknown on line 0

Created at 3 days ago
issue comment
Unable to load dynamic library 'redis.so' on php8.1 with igbinary

Going to close this issue as answered

Created at 3 days ago
issue comment
Add missing configureoption entries in package.xml

Any ETA for a new release including this patch?

Created at 3 days ago
Created at 3 days ago
issue comment
Allow float timeout values for brpop command

Thank you @michael-grunder. Using rawCommand() worked as intended.

Hopefully someone will have enough time to work on this update as it would be great if I could avoid having this "kludge" implemented, but I'm glad I can continue using the extension. 👍

Created at 3 days ago
issue comment
Allow float timeout values for brpop command

We should update the command to take a float, but in the meantime you can always use rawCommand

$r = new Redis; 
$r->connect('localhost', 6379);

$r->rpush('foo', 'a','b','c');
while ($res = $r->rawCommand('brpop', 'foo', .1)) {
    print_r($res);
}
Created at 3 days ago
closed issue
hScan return value doesn't always match php method signature

Expected behaviour

As per hScan documentation, the function should always return an array.

Actual behaviour

It is observed that the method returns false when the hash doesn't have anything set, which makes sense.

Further to this, phpstan and probably the php compiler recognises that this hScan function should only return an array. The method return signature in the extension is probably defining this.

I'm seeing this behaviour on

  • OS: Linux
  • Redis: 6.0.10
  • PHP: 7.4.14
  • phpredis: 5.3.2

Steps to reproduce, backtrace or example script

<?php

$r = new \Redis();
$r->connect('127.0.0.1');
$r->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
$r->hSet('abc123', 'myfield', 'myvalue');

$it = null;

print 'Test #1:' . PHP_EOL;
var_dump($r->hScan('myfield', $it));

print PHP_EOL;

print 'Test #2:' . PHP_EOL;
var_dump($r->hScan('myfield2', $it));

$r->close();

OUTPUT:

Test #1:
array(0) {
}

Test #2:
bool(false)

I've checked

  • 👍 There is no similar issue from other users
  • 👍 Issue isn't fixed in develop branch

Final note

The fix for this can either be as per documentation or to fix the method signature to correctly state the returning of FALSE as an option. Either way works for me.

Created at 3 days ago
issue comment
hScan return value doesn't always match php method signature

Closing this in favor of #1921.

There's a draft PR #2015 to fix these, the issue is it likely requires a major version bump.

Created at 3 days ago

Implement CONFIG RESETSTAT

Rework the CONFIG command and add RESETSTAT variant.

Fixes #1673

Created at 3 days ago

What's failing

Created at 3 days ago

Implement CONFIG RESETSTAT

Rework the CONFIG command and add RESETSTAT variant.

Fixes #1673

Created at 3 days ago
create branch
michael-grunder create branch php8.2-deprecations
Created at 3 days ago
create branch
michael-grunder create branch issue.1673.resetstat
Created at 3 days ago
opened issue
Allow float timeout values for brpop command

Since Redis 6.0 released on 2020 a float value is allowed to define the timeout for brpop commands:

https://github.com/redis/redis/commit/eca0187370c14aa2c126fe07e5310e44c2780a95

https://redis.io/commands/brpop/

Starting with Redis version 6.0.0: timeout is interpreted as a double instead of an integer.

However on redis_commands.c a PHP error occurs if the timeout is not defined as LONG:

if (has_timeout && Z_TYPE(z_args[argc-1])!=IS_LONG) {
    php_error_docref(NULL, E_ERROR,
        "Timeout value must be a LONG");
    efree(z_args);
    return FAILURE;
}

Do you have any plans on updating this extension to support it?

Unfortunately my only solution at the moment is installing the predis library instead since I would like to set a timeout in milliseconds.

Created at 4 days ago
pull request opened
Make sure we set an error for key based scans

See #1661

Created at 4 days ago

Add PHPREDIS_GET_OBJECT and PHPREDIS_ZVAL_GET_OBJECT macros

Fix redis_cluster GET_CONTEXT usage

fix usage php_hash_fetch_ops with PHP 8

Change version_compare usage in tests

Merge branch 'nightly' into develop

Various small changes in cluster_library

Issue #1721

Sanity check for redis_sock->stream before closing.

Fix arginfo for Redis::zadd

Update Changelog.md

Remove duplicate definitions

Remove unused declarations

Update Changelog.md

Set redis_sock->stream to NULL to avoid use-after-free

Update session.save_path in RedisClusterTest::sessionTest

requirepass

Authenticate in redis_sock_server_open

Merge pull request #1731 from phpredis/server-open-auth

Server open auth

Fix documentation to show lPush and rPush are variadic. (#1737)

Addresses #1734

Refactor redis_sock_get_connection_pool

Make unit test authentication configurable (#1748)

Right now cloning the repo and running unit tests will all fail if the Redis/RedisCluster instances aren't configured with the password 'phpredis'.

This commit simply makes authentication during the tests optional via a command-line argument.

Created at 4 days ago
delete branch
michael-grunder delete branch unix-sock-timeout-example
Created at 4 days ago

Add an example with a unix socket and timeout

See: #1663

Created at 4 days ago
closed issue
Add example of how to connect to a unix socket with a timeout

NOTE: This might also be a regression fixed in dev-master

* Fix regression for conntecting to ports > 32767 [1f41da64] (Owen Smith)

Expected behaviour

- *port*: int, optional
+ *port*: int, optional. Set this to null/0 for unix socket paths starting with / if you need to pass other parameters

https://github.com/phpredis/phpredis#connect-open

Actual behaviour

Examples only exist with TCP. There's no explicit documentation of what port you should pass alongside a unix socket if you want to pass a timeout.

I'm seeing this behaviour on

  • OS: Linux
  • Redis: N/A
  • PHP: 7.2
  • phpredis: 5.1.0RC2 - I see that there's a fix added to Redis::CONNECT to convert negative ports to 0.

Steps to reproduce, backtrace or example script

I've checked

  • [x] There is no similar issue from other users
  • [x] Issue isn't fixed in develop branch (Documentation isn't clear on develop, but the bug may have been fixed)

What was the intent of https://github.com/phpredis/phpredis/commit/a080b73f ?

Would the following change make more sense instead?

-     if (address[0] == '/' && redis_sock->port < 1) {
+     if (address[0] == '/' || redis_sock->port < 1) {
Created at 4 days ago