summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy2017-03-04 05:12:08 (GMT)
committerJeremy Andrews2017-03-04 05:12:08 (GMT)
commit25224fbc5486e14bbfeafc324d41fea7fb4ade04 (patch)
tree2eea5c5d9a496829ce72a8adc3fae922d92ae998
parent6924d8ae378062757868c18f7c73e8c6b95c2a22 (diff)
Issue #2856140 by kevinn, Jeremy: Call to undefined function dmemcache_object_cluster()
-rw-r--r--memcache_admin/memcache_admin.install32
-rw-r--r--memcache_admin/memcache_admin.module2
2 files changed, 33 insertions, 1 deletions
diff --git a/memcache_admin/memcache_admin.install b/memcache_admin/memcache_admin.install
index 7c5c711..e05e5aa 100644
--- a/memcache_admin/memcache_admin.install
+++ b/memcache_admin/memcache_admin.install
@@ -6,6 +6,38 @@
*/
/**
+ * Implements hook_requirements().
+ */
+function memcache_admin_requirements($phase) {
+ // Ensure translations don't break during installation.
+ $t = get_t();
+
+ $requirements = array();
+
+ if ($phase == 'install') {
+ if (!function_exists('dmemcache_object_cluster')) {
+ $requirements['memcache_admin'] = array(
+ 'title' => $t('Memcache admin'),
+ 'value' => $t('cache_backends not properly configured in settings.php, failed to load required file memcache.inc.'),
+ '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')),
+ 'severity' => REQUIREMENT_ERROR,
+ );
+ }
+ }
+ else if ($phase == 'runtime') {
+ if (!function_exists('dmemcache_object_cluster') && module_exists('memcache_admin')) {
+ $requirements['memcache_admin'] = array(
+ 'title' => $t('Memcache admin'),
+ 'value' => $t('cache_backends not properly configured in settings.php, failed to load required file memcache.inc.'),
+ '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')),
+ 'severity' => REQUIREMENT_WARNING,
+ );
+ }
+ }
+ return $requirements;
+}
+
+/**
* Flush caches and rebuild menu to allow new stats pages to appear.
*/
function memcache_admin_update_7001() {
diff --git a/memcache_admin/memcache_admin.module b/memcache_admin/memcache_admin.module
index 1d62279..4eba54b 100644
--- a/memcache_admin/memcache_admin.module
+++ b/memcache_admin/memcache_admin.module
@@ -60,7 +60,7 @@ function memcache_admin_menu() {
$memcache_servers = variable_get('memcache_servers', array('127.0.0.1:11211' => 'default'));
$clusters = array();
foreach ($memcache_servers as $server => $bin) {
- if ($cluster = dmemcache_object_cluster($bin)) {
+ if (function_exists('dmemcache_object_cluster') && $cluster = dmemcache_object_cluster($bin)) {
$name = $cluster['cluster'];
$clusters[$name]['servers'][] = $server;
$clusters[$name]['bin'] = _memcache_admin_get_bin_for_cluster($cluster['cluster']);