|
5 | 5 | * Update functions for memcache_admin.
|
6 | 6 | */
|
7 | 7 |
|
| 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 | + |
8 | 40 | /**
|
9 | 41 | * Flush caches and rebuild menu to allow new stats pages to appear.
|
10 | 42 | */
|
|
0 commit comments