mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Predis to v2.2.2
This commit is contained in:
parent
9510347d3a
commit
969dca5f7e
449 changed files with 22013 additions and 2 deletions
77
plugins/cache-redis/Predis/Command/Redis/GEORADIUS.php
Normal file
77
plugins/cache-redis/Predis/Command/Redis/GEORADIUS.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?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;
|
||||
|
||||
use Predis\Command\Command as RedisCommand;
|
||||
|
||||
/**
|
||||
* @deprecated As of Redis version 6.2.0, this command is regarded as deprecated.
|
||||
*
|
||||
* It can be replaced by GEOSEARCH and GEOSEARCHSTORE with the BYRADIUS argument
|
||||
* when migrating or writing new code.
|
||||
*
|
||||
* @see http://redis.io/commands/georadius
|
||||
*/
|
||||
class GEORADIUS extends RedisCommand
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return 'GEORADIUS';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setArguments(array $arguments)
|
||||
{
|
||||
if ($arguments && is_array(end($arguments))) {
|
||||
$options = array_change_key_case(array_pop($arguments), CASE_UPPER);
|
||||
|
||||
if (isset($options['WITHCOORD']) && $options['WITHCOORD'] == true) {
|
||||
$arguments[] = 'WITHCOORD';
|
||||
}
|
||||
|
||||
if (isset($options['WITHDIST']) && $options['WITHDIST'] == true) {
|
||||
$arguments[] = 'WITHDIST';
|
||||
}
|
||||
|
||||
if (isset($options['WITHHASH']) && $options['WITHHASH'] == true) {
|
||||
$arguments[] = 'WITHHASH';
|
||||
}
|
||||
|
||||
if (isset($options['COUNT'])) {
|
||||
$arguments[] = 'COUNT';
|
||||
$arguments[] = $options['COUNT'];
|
||||
}
|
||||
|
||||
if (isset($options['SORT'])) {
|
||||
$arguments[] = strtoupper($options['SORT']);
|
||||
}
|
||||
|
||||
if (isset($options['STORE'])) {
|
||||
$arguments[] = 'STORE';
|
||||
$arguments[] = $options['STORE'];
|
||||
}
|
||||
|
||||
if (isset($options['STOREDIST'])) {
|
||||
$arguments[] = 'STOREDIST';
|
||||
$arguments[] = $options['STOREDIST'];
|
||||
}
|
||||
}
|
||||
|
||||
parent::setArguments($arguments);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue