mirror of
https://github.com/predis/predis.git
synced 2026-08-18 02:41:17 +00:00
Merge branch 'main' of github.com:predis/predis into vv-update-runners
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: /
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "composer"
|
||||
directory: /
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
composer-minor:
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
run: composer validate --no-interaction --strict
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ramsey/composer-install@4.0.0
|
||||
uses: ramsey/composer-install@v4
|
||||
with:
|
||||
dependency-versions: highest
|
||||
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
uses: greut/eclint-action@v0
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ramsey/composer-install@4.0.0
|
||||
uses: ramsey/composer-install@v4
|
||||
with:
|
||||
dependency-versions: highest
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Check Spelling
|
||||
uses: rojopolis/spellcheck-github-actions@0.33.1
|
||||
uses: rojopolis/spellcheck-github-actions@0.60.0
|
||||
with:
|
||||
config_path: .github/spellcheck-settings.yml
|
||||
task_name: Markdown
|
||||
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
run: |
|
||||
# Mapping of original redis versions to client test containers
|
||||
declare -A redis_clients_version_mapping=(
|
||||
["8.8"]="custom-26235535976-debian"
|
||||
["8.8"]="8.8.0"
|
||||
["8.6"]="8.6.1"
|
||||
["8.4"]="8.4.0"
|
||||
["8.2"]="8.2.2"
|
||||
@@ -125,7 +125,7 @@ jobs:
|
||||
coverage: ${{ (matrix.php == '8.4' && matrix.redis == '8.0') && 'xdebug' || 'none' }}
|
||||
|
||||
- name: Install Composer dependencies
|
||||
uses: ramsey/composer-install@4.0.0
|
||||
uses: ramsey/composer-install@v4
|
||||
with:
|
||||
dependency-versions: highest
|
||||
composer-options: ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }}
|
||||
|
||||
+11
-13
@@ -1,26 +1,24 @@
|
||||
## Changelog
|
||||
|
||||
## Unreleased
|
||||
## v3.5.0 (2026-06-02)
|
||||
### Added
|
||||
- Added support for `XNACK` command (#1666)
|
||||
- Added support for `INCREX` command (#1674)
|
||||
- Added support for `UNLINK` command (#1680)
|
||||
- Added support for `AR*` array commands (#1672)
|
||||
- Handle Redis Cluster `-READONLY` responses failover events (#1656)
|
||||
- Added FPHA argument for JSON.SET command (#1661)
|
||||
- Added new COUNT aggregator for Sorted Set commands (#1668)
|
||||
- Added XNACK support (#1666)
|
||||
- Added support for multiple aggregators for TS range commands (#1670)
|
||||
- Added testing for subkey notification channels (#1671)
|
||||
- Added support for new array commands (#1672)
|
||||
- Added support for INCREX command (#1674)
|
||||
- Added `FPHA` argument for `JSON.SET` command (#1661)
|
||||
- Added new `COUNT` aggregator for Sorted Set commands (#1668)
|
||||
- Added support for multiple aggregators for `TS.range` commands (#1670)
|
||||
|
||||
### Changed
|
||||
- Include command name in unsupported container command error messages (#1653)
|
||||
- Updated arguments name for GCRA command (#1667)
|
||||
- Updated INCREX arguments (#1677)
|
||||
|
||||
### Fixed
|
||||
- Fixed handling of gap slots in `SlotMap::offsetUnset()` (#1660)
|
||||
- Fixed ZRANGE to include 6.2 arguments (#1662)
|
||||
- Fixed Sentinel retry to narrow retryable exceptions to CommunicationException (#1665)
|
||||
- Fixed SENTINEL SLAVES RESP3 incompatible response (#1676)
|
||||
- Fixed `ZRANGE` to include 6.2 arguments (#1662)
|
||||
- Fixed Sentinel retry to narrow retryable exceptions to `CommunicationException` (#1665)
|
||||
- Fixed `SENTINEL SLAVES` RESP3 incompatible response (#1676)
|
||||
|
||||
## v3.4.2 (2026-03-09)
|
||||
### Changed
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ use Traversable;
|
||||
*/
|
||||
class Client implements ClientInterface, IteratorAggregate
|
||||
{
|
||||
public const VERSION = '3.4.3-dev';
|
||||
public const VERSION = '3.5.0';
|
||||
|
||||
/** @var OptionsInterface */
|
||||
private $options;
|
||||
|
||||
@@ -77,6 +77,7 @@ use Predis\Command\Redis\VADD;
|
||||
* @method $this sort_ro(string $key, ?string $byPattern = null, ?LimitOffsetCount $limit = null, array $getPatterns = [], ?string $sorting = null, bool $alpha = false)
|
||||
* @method $this ttl($key)
|
||||
* @method $this type($key)
|
||||
* @method $this unlink(string ...$keys)
|
||||
* @method $this append($key, $value)
|
||||
* @method $this arcount(string $key)
|
||||
* @method $this ardel(string $key, int ...$index)
|
||||
|
||||
@@ -87,6 +87,7 @@ use Predis\Response\Status;
|
||||
* @method array sort_ro(string $key, ?string $byPattern = null, ?LimitOffsetCount $limit = null, array $getPatterns = [], ?string $sorting = null, bool $alpha = false)
|
||||
* @method int ttl(string $key)
|
||||
* @method mixed type(string $key)
|
||||
* @method int unlink(string ...$keys)
|
||||
* @method int append(string $key, $value)
|
||||
* @method int arcount(string $key)
|
||||
* @method int ardel(string $key, int ...$index)
|
||||
|
||||
@@ -42,6 +42,7 @@ abstract class ClusterStrategy implements StrategyInterface
|
||||
/* commands operating on the key space */
|
||||
'EXISTS' => $getKeyFromAllArguments,
|
||||
'DEL' => $getKeyFromAllArguments,
|
||||
'UNLINK' => $getKeyFromAllArguments,
|
||||
'TYPE' => $getKeyFromFirstArgument,
|
||||
'EXPIRE' => $getKeyFromFirstArgument,
|
||||
'EXPIREAT' => $getKeyFromFirstArgument,
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Predis package.
|
||||
*
|
||||
* (c) 2009-2020 Daniele Alessandri
|
||||
* (c) 2021-2026 Till Krüss
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Predis\Command\Redis;
|
||||
|
||||
use Predis\Command\PrefixableCommand as RedisCommand;
|
||||
|
||||
/**
|
||||
* @see http://redis.io/commands/unlink
|
||||
*/
|
||||
class UNLINK extends RedisCommand
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return 'UNLINK';
|
||||
}
|
||||
|
||||
public function prefixKeys($prefix)
|
||||
{
|
||||
$this->applyPrefixForAllArguments($prefix);
|
||||
}
|
||||
}
|
||||
@@ -369,6 +369,7 @@ class PredisStrategyTest extends PredisTestCase
|
||||
/* commands operating on the key space */
|
||||
'EXISTS' => 'keys-all',
|
||||
'DEL' => 'keys-all',
|
||||
'UNLINK' => 'keys-all',
|
||||
'TYPE' => 'keys-first',
|
||||
'EXPIRE' => 'keys-first',
|
||||
'EXPIREAT' => 'keys-first',
|
||||
|
||||
@@ -392,6 +392,7 @@ class RedisStrategyTest extends PredisTestCase
|
||||
/* commands operating on the key space */
|
||||
'EXISTS' => 'keys-all',
|
||||
'DEL' => 'keys-all',
|
||||
'UNLINK' => 'keys-all',
|
||||
'TYPE' => 'keys-first',
|
||||
'EXPIRE' => 'keys-first',
|
||||
'EXPIREAT' => 'keys-first',
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Predis package.
|
||||
*
|
||||
* (c) 2009-2020 Daniele Alessandri
|
||||
* (c) 2021-2026 Till Krüss
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Predis\Command\Redis;
|
||||
|
||||
use Predis\Command\PrefixableCommand;
|
||||
|
||||
/**
|
||||
* @group commands
|
||||
* @group realm-key
|
||||
*/
|
||||
class UNLINK_Test extends PredisCommandTestCase
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getExpectedCommand(): string
|
||||
{
|
||||
return 'Predis\Command\Redis\UNLINK';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getExpectedId(): string
|
||||
{
|
||||
return 'UNLINK';
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testFilterArguments(): void
|
||||
{
|
||||
$arguments = ['key1', 'key2', 'key3'];
|
||||
$expected = ['key1', 'key2', 'key3'];
|
||||
|
||||
$command = $this->getCommand();
|
||||
$command->setArguments($arguments);
|
||||
$this->assertSame($expected, $command->getArguments());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testParseResponse(): void
|
||||
{
|
||||
$command = $this->getCommand();
|
||||
|
||||
$this->assertSame(10, $command->parseResponse(10));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testPrefixKeys(): void
|
||||
{
|
||||
/** @var PrefixableCommand $command */
|
||||
$command = $this->getCommand();
|
||||
$actualArguments = ['arg1', 'arg2', 'arg3', 'arg4'];
|
||||
$prefix = 'prefix:';
|
||||
$expectedArguments = ['prefix:arg1', 'prefix:arg2', 'prefix:arg3', 'prefix:arg4'];
|
||||
|
||||
$command->setArguments($actualArguments);
|
||||
$command->prefixKeys($prefix);
|
||||
|
||||
$this->assertSame($expectedArguments, $command->getArguments());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @requiresRedisVersion >= 4.0.0
|
||||
*/
|
||||
public function testReturnsNumberOfUnlinkedKeys(): void
|
||||
{
|
||||
$redis = $this->getClient();
|
||||
|
||||
$this->assertSame(0, $redis->unlink('foo'));
|
||||
|
||||
$redis->set('foo', 'bar');
|
||||
$this->assertSame(1, $redis->unlink('foo'));
|
||||
|
||||
$redis->set('foo', 'bar');
|
||||
$this->assertSame(1, $redis->unlink('foo', 'hoge'));
|
||||
|
||||
$redis->set('foo', 'bar');
|
||||
$redis->set('hoge', 'piyo');
|
||||
$this->assertSame(2, $redis->unlink('foo', 'hoge'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @requiresRedisVersion >= 6.0.0
|
||||
*/
|
||||
public function testReturnsNumberOfUnlinkedKeysResp3(): void
|
||||
{
|
||||
$redis = $this->getResp3Client();
|
||||
|
||||
$this->assertSame(0, $redis->unlink('foo'));
|
||||
|
||||
$redis->set('foo', 'bar');
|
||||
$this->assertSame(1, $redis->unlink('foo'));
|
||||
|
||||
$redis->set('foo', 'bar');
|
||||
$this->assertSame(1, $redis->unlink('foo', 'hoge'));
|
||||
|
||||
$redis->set('foo', 'bar');
|
||||
$redis->set('hoge', 'piyo');
|
||||
$this->assertSame(2, $redis->unlink('foo', 'hoge'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user