mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
Allow connection to Memcached and Redis via unix socket
This commit is contained in:
parent
363f2feeac
commit
1042479d5b
4 changed files with 93 additions and 34 deletions
26
common/framework/drivers/cache/memcached.php
vendored
26
common/framework/drivers/cache/memcached.php
vendored
|
|
@ -45,10 +45,17 @@ class Memcached implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
|
||||
foreach ($config as $url)
|
||||
{
|
||||
$info = parse_url($url);
|
||||
if (isset($info['host']) && isset($info['port']))
|
||||
if (starts_with('/', $url))
|
||||
{
|
||||
$this->_conn->addServer($info['host'], $info['port']);
|
||||
$this->_conn->addServer($url, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$info = parse_url($url);
|
||||
if (isset($info['host']) && isset($info['port']))
|
||||
{
|
||||
$this->_conn->addServer($info['host'], $info['port']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -107,10 +114,17 @@ class Memcached implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
|
||||
foreach ($config as $url)
|
||||
{
|
||||
$info = parse_url($url);
|
||||
if (isset($info['host']) && isset($info['port']))
|
||||
if (starts_with('/', $url))
|
||||
{
|
||||
$conn->addServer($info['host'], $info['port']);
|
||||
$conn->addServer($url, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$info = parse_url($url);
|
||||
if (isset($info['host']) && isset($info['port']))
|
||||
{
|
||||
$conn->addServer($info['host'], $info['port']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue