Compare commits

...

5 Commits

Author SHA1 Message Date
Till Krüss c5b60884e8 tag v2.1.1 2023-01-17 12:57:35 -08:00
Till Krüss 836ab07d40 Fix support options array in ZINTERSTORE and ZUNIONSTORE (#1018)
* support old options array

* fix zinterstore as well

* single override
2023-01-17 12:50:15 -08:00
Fran Moreno 2bfc8a9316 Fix Client template (#1017) 2023-01-17 12:48:39 -08:00
Till Krüss d21576669d remove phpiredis suggestion 2023-01-17 09:42:23 -08:00
Till Krüss 65fe24e346 bump version 2023-01-17 09:42:15 -08:00
7 changed files with 41 additions and 19 deletions
+8 -2
View File
@@ -1,5 +1,11 @@
## Changelog
## v2.1.1 (2023-01-17)
## Bug Fixes
- Fix `@template` in `Predis\Client` (#1017)
- Fix support options array in `ZINTERSTORE` and `ZUNIONSTORE` (#1018)
## v2.1.0 (2023-01-16)
## New Features
@@ -161,7 +167,7 @@
- Support Pub/Sub and Pipelines when using replication
- The class `Predis\Transaction\AbortedMultiExecException` now uses the correct
- The class `Predis\Transaction\AbortedMultiExecException` now uses the correct
default types for the `$code` (integer) parameter.
- __FIX__: using `strval` in `getScanOptions()` method, part of
@@ -169,7 +175,7 @@
string value of `$this->match` and not passing `null` to `strlen()` function.
- __FIX__: the value returned from `getArgument()` in `isReadOperation()` method,
part of `Predis\Replication\ReplicationStrategy` class, is checked to not pass
part of `Predis\Replication\ReplicationStrategy` class, is checked to not pass
`null` to `sha1` function.
- __FIX__: the value returned from `getArgument()` in `parseResponse()`method,
+1 -1
View File
@@ -1 +1 @@
2.0.4-dev
2.1.1
+6 -7
View File
@@ -9,16 +9,16 @@
"issues": "https://github.com/predis/predis/issues"
},
"authors": [
{
"name": "Daniele Alessandri",
"email": "suppakilla@gmail.com",
"homepage": "http://clorophilla.net",
"role": "Creator & Maintainer"
},
{
"name": "Till Krüss",
"homepage": "https://till.im",
"role": "Maintainer"
},
{
"name": "Daniele Alessandri",
"email": "suppakilla@gmail.com",
"homepage": "http://clorophilla.net",
"role": "Creator"
}
],
"funding": [
@@ -34,7 +34,6 @@
"phpunit/phpunit": "^8.0 || ~9.4.4"
},
"suggest": {
"ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol",
"ext-curl": "Allows access to Webdis when paired with phpiredis"
},
"autoload": {
+3 -7
View File
@@ -36,16 +36,13 @@ use Predis\Transaction\MultiExec as MultiExecTransaction;
* abstractions are built. Internally it aggregates various other classes each
* one with its own responsibility and scope.
*
* {@inheritdoc}
* @template TKey
* @template TValue
* @template-implements Traversable<TKey, TValue>
* @template-implements \IteratorAggregate<string, static>
*
* @author Daniele Alessandri <suppakilla@gmail.com>
*/
class Client implements ClientInterface, \IteratorAggregate
{
const VERSION = '2.1.0';
const VERSION = '2.1.1';
/** @var OptionsInterface */
private $options;
@@ -516,8 +513,7 @@ class Client implements ClientInterface, \IteratorAggregate
}
/**
* {@inheritdoc}
* @return Traversable<TKey, TValue>|TValue[]
* @return Traversable<string, static>
*/
#[\ReturnTypeWillChange]
public function getIterator()
+7
View File
@@ -50,6 +50,13 @@ class ZUNIONSTORE extends RedisCommand
*/
public function setArguments(array $arguments)
{
// support old `$options` array for backwards compatibility
if (! isset($arguments[3]) && (isset($arguments[2]['weights']) || isset($arguments[2]['aggregate']))) {
$options = array_pop($arguments);
array_push($arguments, $options['weights'] ?? []);
array_push($arguments, $options['aggregate'] ?? 'sum');
}
$this->setAggregate($arguments);
$arguments = $this->getArguments();
@@ -153,7 +153,14 @@ class ZINTERSTORE_Test extends PredisCommandTestCase
'with all arguments' => [
['destination', ['key1', 'key2'], [1, 2], 'min'],
['destination', 2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN'],
]
],
'with options array' => [
['destination', ['key1', 'key2'], [
'weights' => [1, 2],
'aggregate' => 'min',
]],
['destination', 2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN'],
],
];
}
@@ -153,7 +153,14 @@ class ZUNIONSTORE_Test extends PredisCommandTestCase
'with all arguments' => [
['destination', ['key1', 'key2'], [1, 2], 'min'],
['destination', 2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN'],
]
],
'with options array' => [
['destination', ['key1', 'key2'], [
'weights' => [1, 2],
'aggregate' => 'min',
]],
['destination', 2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN'],
],
];
}