@@ -580,7 +580,10 @@ function dmemcache_connect($memcache, $server, $connection) {
$extension=dmemcache_extension();
list($host,$port)=explode(':',$server);
@list($host,$port)=explode(':',trim($server));
if(empty($host)){
register_shutdown_function('watchdog','memcache','You have specified an invalid address of "!server" in settings.php. Please review README.txt for proper configuration.',array('!server'=>$server,'!ip'=>t('127.0.0.1:11211'),'!host'=>t('localhost:11211'),'!socket'=>t('unix:///path/to/socket')),WATCHDOG_WARNING);
}
if($extension=='Memcache'){
// Allow persistent connection via Memcache extension -- note that this
...
...
@@ -597,6 +600,9 @@ function dmemcache_connect($memcache, $server, $connection) {
$host=$server;
$port=0;
}
elseif(!isset($port)){
register_shutdown_function('watchdog','memcache','You have specified an invalid address of "!server" in settings.php which does not include a port. Please review README.txt for proper configuration. You must specify both a server address and port such as "!ip" or "!host", or a unix socket such as "!socket".',array('!server'=>$server,'!ip'=>t('127.0.0.1:11211'),'!host'=>t('localhost:11211'),'!socket'=>t('unix:///path/to/socket')),WATCHDOG_WARNING);
}
// When using the PECL memcache extension, we must use ->(p)connect
// for the first connection.
...
...
@@ -629,6 +635,9 @@ function dmemcache_connect($memcache, $server, $connection) {
$host=substr($server,7);
$port=0;
}
elseif(!isset($port)){
register_shutdown_function('watchdog','memcache','You have specified an invalid address of "!server" in settings.php which does not include a port. Please review README.txt for proper configuration. You must specify both a server address and port such as "!ip" or "!host", or a unix socket such as "!socket".',array('!server'=>$server,'!ip'=>t('127.0.0.1:11211'),'!host'=>t('localhost:11211'),'!socket'=>t('unix:///path/to/socket')),WATCHDOG_WARNING);