Skip to content

Commit 25224fb

Browse files
JeremyJeremy Andrews
Jeremy
authored and
Jeremy Andrews
committed
Issue #2856140 by kevinn, Jeremy: Call to undefined function dmemcache_object_cluster()
1 parent 6924d8a commit 25224fb

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

memcache_admin/memcache_admin.install

+32
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,38 @@
55
* Update functions for memcache_admin.
66
*/
77

8+
/**
9+
* Implements hook_requirements().
10+
*/
11+
function memcache_admin_requirements($phase) {
12+
// Ensure translations don't break during installation.
13+
$t = get_t();
14+
15+
$requirements = array();
16+
17+
if ($phase == 'install') {
18+
if (!function_exists('dmemcache_object_cluster')) {
19+
$requirements['memcache_admin'] = array(
20+
'title' => $t('Memcache admin'),
21+
'value' => $t('cache_backends not properly configured in settings.php, failed to load required file memcache.inc.'),
22+
'description' => $t('You must properly configure cache_backends in %settings before enabling the memcache_admin module. Please review %readme for more information.', array('%settings' => 'settings.php', '%readme' => 'README.txt')),
23+
'severity' => REQUIREMENT_ERROR,
24+
);
25+
}
26+
}
27+
else if ($phase == 'runtime') {
28+
if (!function_exists('dmemcache_object_cluster') && module_exists('memcache_admin')) {
29+
$requirements['memcache_admin'] = array(
30+
'title' => $t('Memcache admin'),
31+
'value' => $t('cache_backends not properly configured in settings.php, failed to load required file memcache.inc.'),
32+
'description' => $t('You have enabled the memcache_admin module without properly configuring cache_backends in %settings. Please review %readme for more information.', array('%settings' => 'settings.php', '%readme' => 'README.txt')),
33+
'severity' => REQUIREMENT_WARNING,
34+
);
35+
}
36+
}
37+
return $requirements;
38+
}
39+
840
/**
941
* Flush caches and rebuild menu to allow new stats pages to appear.
1042
*/

memcache_admin/memcache_admin.module

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function memcache_admin_menu() {
6060
$memcache_servers = variable_get('memcache_servers', array('127.0.0.1:11211' => 'default'));
6161
$clusters = array();
6262
foreach ($memcache_servers as $server => $bin) {
63-
if ($cluster = dmemcache_object_cluster($bin)) {
63+
if (function_exists('dmemcache_object_cluster') && $cluster = dmemcache_object_cluster($bin)) {
6464
$name = $cluster['cluster'];
6565
$clusters[$name]['servers'][] = $server;
6666
$clusters[$name]['bin'] = _memcache_admin_get_bin_for_cluster($cluster['cluster']);

0 commit comments

Comments
 (0)