function performance_enabled_memcache in Performance Logging and Monitoring 6
Same name and namespace in other branches
- 7 performance.module \performance_enabled_memcache()
Helper function to check if Memcache is available.
Parameters
$form whether or not we're called from the settings form:
$message whether or not to display an additional message:
Return value
boolean
See also
File
- ./
performance.module, line 599 - Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com
Code
function performance_enabled_memcache($form = FALSE, $message = FALSE) {
global $conf;
$setting = variable_get('performance_summary_memcache', 0);
if ($form) {
$setting = TRUE;
}
if (function_exists('dmemcache_set') && $setting) {
if (isset($conf['memcache_bins']['cache_performance'])) {
return TRUE;
}
elseif ($message) {
$message = t("Memcache detected, but no specific 'cache_performance' bin has been defined. See README.txt for configuration details.");
drupal_set_message($message, 'warning', FALSE);
return FALSE;
}
}
}