Test for 'false' database value when not found in DSN

This commit is contained in:
Iskandar Najmuddin 2014-05-05 14:55:01 +00:00
parent 1abbad3f5e
commit d1d2b3b354
2 changed files with 21 additions and 13 deletions

View file

@ -109,7 +109,8 @@ class Resque_Redis
/**
* @param string|array $server A DSN or array
* @param int $database A database number to select
* @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.
*/
public function __construct($server, $database = null)
{
@ -134,7 +135,7 @@ class Resque_Redis
}
// If we have found a database in our DSN, use it instead of the `$database`
// value passed into the constructor
// value passed into the constructor.
if ($dsnDatabase !== false) {
$database = $dsnDatabase;
$this->database = $database;