Skip to content
Snippets Groups Projects
Commit 42b00572 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Add support for UNIX sockets in memcache.

parent b1c266f9
No related branches found
No related tags found
No related merge requests found
......@@ -207,8 +207,17 @@ class SimpleSAML_Memcache
);
}
// check if we are told to use a socket
$socket = false;
if (strpos($hostname, 'unix:///') === 0) {
$socket = true;
}
// check if the user has specified a port number
if (array_key_exists('port', $server)) {
if ($socket) {
// force port to be 0 for sockets
$port = 0;
} elseif (array_key_exists('port', $server)) {
// get the port number from the array, and validate it
$port = (int) $server['port'];
if (($port <= 0) || ($port > 65535)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment