mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 13:42:22 +00:00
use a mock to test correct redis exceptions are surfaced
This commit is contained in:
parent
599dc4c8be
commit
8113e624c4
3 changed files with 24 additions and 4 deletions
|
@ -108,13 +108,17 @@ class Resque_Redis
|
|||
* @param string|array $server A DSN or array
|
||||
* @param int $database A database number to select. However, if we find a valid database number in the DSN the
|
||||
* DSN-supplied value will be used instead and this parameter is ignored.
|
||||
* @param object $client Optional Credis_Cluster or Credis_Client instance instantiated by you
|
||||
*/
|
||||
public function __construct($server, $database = null)
|
||||
public function __construct($server, $database = null, $client = null)
|
||||
{
|
||||
try {
|
||||
if (is_array($server)) {
|
||||
$this->driver = new Credis_Cluster($server);
|
||||
}
|
||||
else if (is_object($client)) {
|
||||
$this->driver = $client;
|
||||
}
|
||||
else {
|
||||
list($host, $port, $dsnDatabase, $user, $password, $options) = self::parseDsn($server);
|
||||
// $user is not used, only $password
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue