"Cache", 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items['admin/config/development/performance/redis'] = array( 'title' => "Redis", 'page callback' => 'drupal_get_form', 'page arguments' => array('redis_settings_form'), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'file' => 'redis.admin.inc', ); return $items; } /** * Implements hook_help(). */ function redis_help($path, $arg) { switch ($path) { case 'admin/config/development/performance/redis': $messages = '

' . t("Redis module is optional if you are using only a cache or lock backend. The full API will be automatically loaded and its configuration will live into the settings.php file. If you access to this screen, it's probably because another contrib module needs it as a dependency for using the Redis client. If you didn't enabled such module, you are strongly advised to disable the Redis module on the module page.") . '

' . '

' . t("While Redis client configuration can be changed through the web, if you are using a cache or lock backend they must be set in the settings.php file. Once this done, any modification done using this form will be ignored, and real settings in use will be get at early bootstrap phase, before the configuration system is bootstrapped.") . '

'; if (Redis_Client::getClient()) { $messages .= '

' . t("Current connected client uses the @name library.", array('@name' => Redis_Client::getClientInterfaceName())) . '

'; } return $messages; } } /** * Get Redis client for php-redis extension. * * @return \Redis */ function phpredis_client_get() { if ('PhpRedis' !== variable_get('redis_client_interface')) { throw new \LogicException("Redis is not configured to use the php-redis client"); } return Redis_Client::getClient(); } /** * Get Redis client for Predis library. * * @return \Predis\Client */ function predis_client_get() { if ('Predis' !== variable_get('redis_client_interface')) { throw new \LogicException("Redis is not configured to use the Predis client"); } return Redis_Client::getClient(); }