mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 08:15:14 +00:00
Add support for unprotected unix socket
- You can now provide a unix socket based redis connection: - `Resque::setBackend('unix:///path/to/redis.sock')` - username/password/db in unix socket dsn currently unsupported: - This middle layer for Dsn parsing seemed too clunky for me to introduce user/pass/db parsing for unix sockets.
This commit is contained in:
parent
6273fdd193
commit
4b85638ccf
@ -148,6 +148,7 @@ class Resque_Redis
|
|||||||
* - host:port
|
* - host:port
|
||||||
* - redis://user:pass@host:port/db?option1=val1&option2=val2
|
* - redis://user:pass@host:port/db?option1=val1&option2=val2
|
||||||
* - tcp://user:pass@host:port/db?option1=val1&option2=val2
|
* - tcp://user:pass@host:port/db?option1=val1&option2=val2
|
||||||
|
* - unix:///path/to/redis.sock
|
||||||
*
|
*
|
||||||
* Note: the 'user' part of the DSN is not used.
|
* Note: the 'user' part of the DSN is not used.
|
||||||
*
|
*
|
||||||
@ -161,6 +162,16 @@ class Resque_Redis
|
|||||||
// Use a sensible default for an empty DNS string
|
// Use a sensible default for an empty DNS string
|
||||||
$dsn = 'redis://' . self::DEFAULT_HOST;
|
$dsn = 'redis://' . self::DEFAULT_HOST;
|
||||||
}
|
}
|
||||||
|
if(substr($dsn, 0, 7) === 'unix://') {
|
||||||
|
return array(
|
||||||
|
$dsn,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
}
|
||||||
$parts = parse_url($dsn);
|
$parts = parse_url($dsn);
|
||||||
|
|
||||||
// Check the URI scheme
|
// Check the URI scheme
|
||||||
|
Loading…
Reference in New Issue
Block a user