Additionally remove `.github` from our root-level `.gitignore` file. I
assume it was erroneously added some time ago since we have files in
this repo.
Fixes#2705
It seems like Redis changed what it will do when you send a negative
number of events. Previously this would just return an error but it
seems to return `1` now.
For this reason just remove that assertion so we don't have to use
different logic depending on the version of the server.
* PHP < 8.0 took a `char*` as `php_json_decode` input, whereas newer
versions take a const char * so ifdef around this.
* Fix compilation errors due to `false` not being defined. So as to make
a minimal change we can just use 0 and 1
Unfortunately `VEMB` has a unique `RESP2` reply as far as I can tell,
where it sends the embedding mode (int8, bin, fp32) as a simple string.
This would cause any of PhpRedis' generic reply handlers to turn that
into `true` which isn't useful. For that reason we need a custom reply
handler.
Additionally slightly rework `VINFO` to short circuit and return failure
if we read anything other than a bulk string or an integer reply type.
Otherwise we may get out of sync on the socket.
See #2543
All of these commands have the same form `<cmd> key`. `VINFO` is a bit
of an outlier however that uses simple strings as opposed to bulk
strings for the key names, meaning we had to create a custom handler.
See #2543
Valkey 9.0.0 implemented a new variant of `GEOSEARCH` where you supply
the verticies to an arbitrary polygon.
Since we can't modify the `geosearch` prototype using it is a little
wonky (you need to just pass empty strings for position and unit).
```php
$redis->geosearch('ca:cities', '', [
-121.90, 39.65, -121.77, 39.65, -121.77, 39.80, -121.90, 39.80
], '');
$redis->geosearchstore('ca:cities', 'dst', '', [
-121.90, 39.65, -121.77, 39.65, -121.77, 39.80, -121.90, 39.80
], '');
```
When the slot's->slaves was null, it was dereferencing null, causing
segfault.
This happens in weird scenario when some of the nodes in cluster are
down or having changed IP addresses without knowing about it.
This is likely to never happen but just skipping NULL nodes is better than aborting the reset.
Co-authored-by: Pavlo Yatsukhnenko <yatsukhnenko@users.noreply.github.com>
This wrapper macro implicitly defines an `} else {` block but this is
not clear at the callsite which obsures what is actually going on.
There's no real advantage to the wrapping macro. Instead just call the
underlying macro in an explicit else branch.