mirror of
https://github.com/idanoo/laravel-resque.git
synced 2024-11-23 08:55:21 +00:00
use dsn to connect to redis
This commit is contained in:
parent
61a27ddb7d
commit
781c8d2462
@ -53,9 +53,15 @@ class ResqueServiceProvider extends ServiceProvider
|
|||||||
$host = isset($config['host']) ? $config['host'] : 'localhost';
|
$host = isset($config['host']) ? $config['host'] : 'localhost';
|
||||||
$port = isset($config['port']) ? $config['port'] : 6379;
|
$port = isset($config['port']) ? $config['port'] : 6379;
|
||||||
$database = isset($config['database']) ? $config['database'] : 0;
|
$database = isset($config['database']) ? $config['database'] : 0;
|
||||||
|
$password = isset($config['password']) ? $config['password'] : '';
|
||||||
|
|
||||||
$server = implode(':', [$host, $port]);
|
$server = implode(':', [$host, $port]);
|
||||||
|
if ($password) {
|
||||||
|
$server = implode('@', [$password, $server]);
|
||||||
|
}
|
||||||
|
|
||||||
\Resque::setBackend($server, $database);
|
$dsn = sprintf('redis://%s/%s', $server, $database);
|
||||||
|
|
||||||
|
\Resque::setBackend($dsn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user