-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from cheprasov/dev-1.3.0
v1.3.0
- Loading branch information
Showing
17 changed files
with
359 additions
and
59 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
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
49 changes: 49 additions & 0 deletions
49
src/RedisClient/Command/Traits/Version3x2/StringsCommandsTrait.php
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,49 @@ | ||
<?php | ||
/** | ||
* This file is part of RedisClient. | ||
* git: https://github.com/cheprasov/php-redis-client | ||
* | ||
* (C) Alexander Cheprasov <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace RedisClient\Command\Traits\Version3x2; | ||
|
||
use RedisClient\Command\Traits\Version2x8\StringsCommandsTrait as StringsCommandsTraitVersion2x8; | ||
|
||
/** | ||
* Strings Commands | ||
* @link http://redis.io/commands#string | ||
*/ | ||
trait StringsCommandsTrait { | ||
|
||
use StringsCommandsTraitVersion2x8; | ||
|
||
/** | ||
* BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL] | ||
* Available since 3.2.0. | ||
* Time complexity: O(1) for each subcommand specified | ||
* | ||
* @param string $key | ||
* @param array $subcommands Example: [['GET', 'type', 'offset'], ['OVERFLOW', 'WRAP'], ['SET', 'type', 'offset', 'value']] | ||
* @return mixed | ||
*/ | ||
public function bitfield($key, array $subcommands) { | ||
$params = [$key]; | ||
// I know, I know... but it is faster! | ||
if (is_array($subcommands[0])) { | ||
foreach ($subcommands as $subcommand) { | ||
foreach ($subcommand as $p) { | ||
$params[] = $p; | ||
} | ||
} | ||
} else { | ||
foreach ($subcommands as $p) { | ||
$params[] = $p; | ||
} | ||
} | ||
return $this->returnCommand(['BITFIELD'], $params); | ||
} | ||
|
||
} |
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
Oops, something went wrong.