You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Support unix sockets of the format 'unix:///path/to/socket'.
804
813
if ($host == 'unix') {
805
814
// Use full protocol and path as expected by Memcache extension.
806
815
$host = $server;
807
816
$port = 0;
808
817
}
809
818
elseif (!isset($port)) {
810
-
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);
811
-
}
812
-
813
-
// When using the PECL memcache extension, we must use ->(p)connect
814
-
// for the first connection.
815
-
if (!$connection) {
816
-
$track_errors = ini_set('track_errors', '1');
817
-
$php_errormsg = '';
818
-
819
-
// The Memcache extension requires us to use (p)connect for the first
820
-
// server we connect to.
821
-
if ($memcache_persistent) {
822
-
$rc = @$memcache->pconnect($host, $port);
823
-
}
824
-
else {
825
-
$rc = @$memcache->connect($host, $port);
826
-
}
827
-
if (!empty($php_errormsg)) {
828
-
register_shutdown_function('watchdog', 'memcache', 'Exception caught in dmemcache_connect while connecting to !host:!port: !msg', array('!host' => $host, '!port' => $port, '!msg' => $php_errormsg), WATCHDOG_WARNING);
@@ -842,27 +827,34 @@ function dmemcache_connect($memcache, $server, $connection) {
842
827
$port = 0;
843
828
}
844
829
elseif (!isset($port)) {
845
-
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);
830
+
$port_error = TRUE;
846
831
}
832
+
}
833
+
834
+
if ($port_error) {
835
+
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);
@@ -272,47 +274,45 @@ function memcache_admin_stats($bin = 'default') {
272
274
$output = '';
273
275
$server = array();
274
276
$stats = dmemcache_stats($bin, 'default', TRUE);
275
-
if (empty($stats)) {
277
+
if (empty($stats[$bin])) {
276
278
// Failed to load statistics. Provide a useful error about where to get
277
279
// more information and help.
278
-
drupal_set_message(t('There may be a problem with your Memcache configuration. Please review %readme and !more for more information.', array('%readme' => 'README.txt', 'admin/reports/status', '!more' => module_exists('memcache') ? t('visit the Drupal admin !status page', array('!status' => l(t('status report'), 'admin/reports/status'))) : t('!enable the memcache module', array('!enable' => l(t('enable'), 'admin/modules', array('fragment' => 'edit-modules-performance-and-scalability')))))), 'error');
280
+
drupal_set_message(t('Failed to retreive statistics. There may be a problem with your Memcache configuration. Please review %readme and !more for more information.', array('%readme' => 'README.txt', 'admin/reports/status', '!more' => module_exists('memcache') ? t('visit the Drupal admin !status page', array('!status' => l(t('status report'), 'admin/reports/status'))) : t('!enable the memcache module', array('!enable' => l(t('enable'), 'admin/modules', array('fragment' => 'edit-modules-performance-and-scalability')))))), 'error');
0 commit comments