-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better compatibility with yii2-redis
- Loading branch information
Pavle Lee
committed
Aug 26, 2017
1 parent
9720d48
commit e02d59a
Showing
14 changed files
with
236 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
<?php | ||
/** | ||
* User: Pavle Lee <[email protected]> | ||
* Date: 2017/8/26 | ||
* Time: 16:29 | ||
*/ | ||
|
||
namespace pavle\yii\redis\Command; | ||
|
||
|
||
class ClientList extends \Predis\Command\ServerClient | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getArguments() | ||
{ | ||
return ['LIST']; | ||
} | ||
|
||
|
||
/** | ||
* Parses the response to CLIENT LIST and returns a structured list. | ||
* | ||
* @param string $data Response buffer. | ||
* | ||
* @return string | ||
*/ | ||
protected function parseClientList($data) | ||
{ | ||
return $data; | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
/** | ||
* User: Pavle Lee <[email protected]> | ||
* Date: 2017/8/26 | ||
* Time: 16:29 | ||
*/ | ||
|
||
namespace pavle\yii\redis\Command; | ||
|
||
|
||
class ClientSetName extends \Predis\Command\ServerClient | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getArguments() | ||
{ | ||
return array_merge(['SETNAME'], parent::getArguments()); | ||
} | ||
|
||
|
||
/** | ||
* Parses the response to CLIENT LIST and returns a structured list. | ||
* | ||
* @param string $data Response buffer. | ||
* | ||
* @return string | ||
*/ | ||
protected function parseClientList($data) | ||
{ | ||
return $data; | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
/** | ||
* User: Pavle Lee <[email protected]> | ||
* Date: 2017/8/26 | ||
* Time: 16:11 | ||
*/ | ||
|
||
namespace pavle\yii\redis\Command; | ||
|
||
|
||
use Predis\Command\Command; | ||
|
||
class HashGetAll extends Command | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return 'HGETALL'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function parseResponse($data) | ||
{ | ||
return $data; | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion200 extends \Predis\Profile\RedisVersion200 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion220 extends \Predis\Profile\RedisVersion220 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion240 extends \Predis\Profile\RedisVersion240 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion260 extends \Predis\Profile\RedisVersion260 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion280 extends \Predis\Profile\RedisVersion280 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion300 extends \Predis\Profile\RedisVersion300 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace pavle\yii\redis\Profile; | ||
|
||
|
||
class RedisVersion320 extends \Predis\Profile\RedisVersion320 | ||
{ | ||
public function getSupportedCommands() | ||
{ | ||
return array_merge(parent::getSupportedCommands(), [ | ||
'HGETALL' => 'pavle\yii\redis\Command\HashGetAll', | ||
'CLIENT LIST' => 'pavle\yii\redis\Command\ClientList', | ||
'CLIENT SETNAME' => 'pavle\yii\redis\Command\ClientSetName', | ||
]); | ||
} | ||
} |