You are here

memcache_admin.install in Memcache API and Integration 6

Install, update and uninstall functions for the memcache_admin module.

File

memcache_admin/memcache_admin.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the memcache_admin module.
 */

/**
 * Implementation of hook_requirements().
 */
function memcache_admin_requirements($phase) {
  $t = get_t();
  $requirements = array();
  if ($phase == 'runtime') {
    $requirements['memcache_admin']['title'] = $t('Memcache admin');
    if (function_exists('dmemcache_stats')) {
      $requirements['memcache_admin']['value'] = $t('Memcache included');
      $requirements['memcache_admin']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['memcache_admin']['value'] = $t('Memcache not included');
      $requirements['memcache_admin']['description'] = $t('Memcache admin requires that the "cache_inc" $conf variable be set to include either memcache.inc or memcache.db.inc. Please read the !instructions.', array(
        '!instructions' => l($t('installation instructions'), 'http://drupal.org/project/memcache'),
      ));
      $requirements['memcache_admin']['severity'] = REQUIREMENT_ERROR;
    }
  }
  return $requirements;
}
function memcache_admin_update_6001() {
  drupal_flush_all_caches();
  menu_rebuild();
  return array();
}