Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1.1-commands-redis-3.2'
- Loading branch information
Showing
29 changed files
with
2,071 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Predis package. | ||
* | ||
* (c) Daniele Alessandri <suppakilla@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Predis\Command; | ||
|
||
/** | ||
* @link http://redis.io/commands/geoadd | ||
* | ||
* @author Daniele Alessandri <suppakilla@gmail.com> | ||
*/ | ||
class GeospatialGeoAdd extends Command | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'GEOADD'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function filterArguments(array $arguments) | ||
{ | ||
if (count($arguments) === 2 && is_array($arguments[1])) { | ||
foreach (array_pop($arguments) as $item) { | ||
$arguments = array_merge($arguments, $item); | ||
} | ||
} | ||
|
||
return $arguments; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Predis package. | ||
* | ||
* (c) Daniele Alessandri <suppakilla@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Predis\Command; | ||
|
||
/** | ||
* @link http://redis.io/commands/geodist | ||
* | ||
* @author Daniele Alessandri <suppakilla@gmail.com> | ||
*/ | ||
class GeospatialGeoDist extends Command | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'GEODIST'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Predis package. | ||
* | ||
* (c) Daniele Alessandri <suppakilla@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Predis\Command; | ||
|
||
/** | ||
* @link http://redis.io/commands/geohash | ||
* | ||
* @author Daniele Alessandri <suppakilla@gmail.com> | ||
*/ | ||
class GeospatialGeoHash extends Command | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'GEOHASH'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function filterArguments(array $arguments) | ||
{ | ||
if (count($arguments) === 2 && is_array($arguments[1])) { | ||
$members = array_pop($arguments); | ||
$arguments = array_merge($arguments, $members); | ||
} | ||
|
||
return $arguments; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Predis package. | ||
* | ||
* (c) Daniele Alessandri <suppakilla@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Predis\Command; | ||
|
||
/** | ||
* @link http://redis.io/commands/geopos | ||
* | ||
* @author Daniele Alessandri <suppakilla@gmail.com> | ||
*/ | ||
class GeospatialGeoPos extends Command | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'GEOPOS'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function filterArguments(array $arguments) | ||
{ | ||
if (count($arguments) === 2 && is_array($arguments[1])) { | ||
$members = array_pop($arguments); | ||
$arguments = array_merge($arguments, $members); | ||
} | ||
|
||
return $arguments; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Predis package. | ||
* | ||
* (c) Daniele Alessandri <suppakilla@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Predis\Command; | ||
|
||
/** | ||
* @link http://redis.io/commands/georadius | ||
* | ||
* @author Daniele Alessandri <suppakilla@gmail.com> | ||
*/ | ||
class GeospatialGeoRadius extends Command | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'GEORADIUS'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function filterArguments(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']; | ||
} | ||
} | ||
|
||
return $arguments; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Predis package. | ||
* | ||
* (c) Daniele Alessandri <suppakilla@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Predis\Command; | ||
|
||
/** | ||
* @link http://redis.io/commands/georadiusbymember | ||
* | ||
* @author Daniele Alessandri <suppakilla@gmail.com> | ||
*/ | ||
class GeospatialGeoRadiusByMember extends GeospatialGeoRadius | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'GEORADIUSBYMEMBER'; | ||
} | ||
} |
Oops, something went wrong.