Predis to v2.2.2

This commit is contained in:
the-djmaze 2024-04-08 16:29:55 +02:00
parent 9510347d3a
commit 969dca5f7e
449 changed files with 22013 additions and 2 deletions

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.arrappend/
*
* Append the json values into the array at path after the last element in it
*/
class JSONARRAPPEND extends RedisCommand
{
public function getId()
{
return 'JSON.ARRAPPEND';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.arrindex/
*
* Search for the first occurrence of a JSON value in an array
*/
class JSONARRINDEX extends RedisCommand
{
public function getId()
{
return 'JSON.ARRINDEX';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.arrinsert/
*
* Insert the json values into the array at path before the index (shifts to the right)
*/
class JSONARRINSERT extends RedisCommand
{
public function getId()
{
return 'JSON.ARRINSERT';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.arrlen/
*
* Report the length of the JSON array at path in key
*/
class JSONARRLEN extends RedisCommand
{
public function getId()
{
return 'JSON.ARRLEN';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.arrpop/
*
* Remove and return an element from the index in the array
*/
class JSONARRPOP extends RedisCommand
{
public function getId()
{
return 'JSON.ARRPOP';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.arrtrim/
*
* Trim an array so that it contains only the specified inclusive range of elements
*/
class JSONARRTRIM extends RedisCommand
{
public function getId()
{
return 'JSON.ARRTRIM';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.clear/
*
* Clear container values (arrays/objects) and set numeric values to 0
*/
class JSONCLEAR extends RedisCommand
{
public function getId()
{
return 'JSON.CLEAR';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.debug/
*
* This is a container command for debugging related tasks.
*/
class JSONDEBUG extends RedisCommand
{
public function getId()
{
return 'JSON.DEBUG';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.del/
*
* Delete a value
*/
class JSONDEL extends RedisCommand
{
public function getId()
{
return 'JSON.DEL';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.forget/
*
* @see https://redis.io/commands/json.del/
*/
class JSONFORGET extends RedisCommand
{
public function getId()
{
return 'JSON.FORGET';
}
}

View file

@ -0,0 +1,57 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
use Predis\Command\Traits\Json\Indent;
use Predis\Command\Traits\Json\Newline;
use Predis\Command\Traits\Json\Space;
/**
* @see https://redis.io/commands/json.get/
*
* Return the value at path in JSON serialized form
*/
class JSONGET extends RedisCommand
{
use Indent {
Indent::setArguments as setIndent;
}
use Newline {
Newline::setArguments as setNewline;
}
use Space {
Space::setArguments as setSpace;
}
protected static $indentArgumentPositionOffset = 1;
protected static $newlineArgumentPositionOffset = 2;
protected static $spaceArgumentPositionOffset = 3;
public function getId()
{
return 'JSON.GET';
}
public function setArguments(array $arguments)
{
$this->setSpace($arguments);
$arguments = $this->getArguments();
$this->setNewline($arguments);
$arguments = $this->getArguments();
$this->setIndent($arguments);
$this->filterArguments();
}
}

View file

@ -0,0 +1,29 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.merge/
*
* Merge a given JSON value into matching paths.
* Consequently, JSON values at matching paths are updated, deleted, or expanded with new children.
*/
class JSONMERGE extends RedisCommand
{
public function getId()
{
return 'JSON.MERGE';
}
}

View file

@ -0,0 +1,36 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
class JSONMGET extends RedisCommand
{
public function getId()
{
return 'JSON.MGET';
}
public function setArguments(array $arguments)
{
$unpackedArguments = [];
foreach ($arguments[0] as $key) {
$unpackedArguments[] = $key;
}
$unpackedArguments[] = $arguments[1];
parent::setArguments($unpackedArguments);
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.mset/
*
* Set or update one or more JSON values according to the specified key-path-value triplets.
*/
class JSONMSET extends RedisCommand
{
public function getId()
{
return 'JSON.MSET';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.numincrby/
*
* Increment the number value stored at path by number
*/
class JSONNUMINCRBY extends RedisCommand
{
public function getId()
{
return 'JSON.NUMINCRBY';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.objkeys/
*
* Return the keys in the object that's referenced by path
*/
class JSONOBJKEYS extends RedisCommand
{
public function getId()
{
return 'JSON.OBJKEYS';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.objlen/
*
* Report the number of keys in the JSON object at path in key
*/
class JSONOBJLEN extends RedisCommand
{
public function getId()
{
return 'JSON.OBJLEN';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.resp/
*
* Return the JSON in key in Redis serialization protocol specification form
*/
class JSONRESP extends RedisCommand
{
public function getId()
{
return 'JSON.RESP';
}
}

View file

@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
use Predis\Command\Traits\Json\NxXxArgument;
/**
* @see https://redis.io/commands/json.set/
*
* Set the JSON value at path in key
*/
class JSONSET extends RedisCommand
{
use NxXxArgument {
setArguments as setSubcommand;
}
protected static $nxXxArgumentPositionOffset = 3;
public function getId()
{
return 'JSON.SET';
}
public function setArguments(array $arguments)
{
$this->setSubcommand($arguments);
$this->filterArguments();
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.strappend/
*
* Append the json-string values to the string at path
*/
class JSONSTRAPPEND extends RedisCommand
{
public function getId()
{
return 'JSON.STRAPPEND';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.strlen/
*
* Report the length of the JSON String at path in key
*/
class JSONSTRLEN extends RedisCommand
{
public function getId()
{
return 'JSON.STRLEN';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.toggle/
*
* Toggle a Boolean value stored at path
*/
class JSONTOGGLE extends RedisCommand
{
public function getId()
{
return 'JSON.TOGGLE';
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 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\Json;
use Predis\Command\Command as RedisCommand;
/**
* @see https://redis.io/commands/json.type/
*
* Report the type of JSON value at path
*/
class JSONTYPE extends RedisCommand
{
public function getId()
{
return 'JSON.TYPE';
}
}