redis-8.x-1.x-dev/redis.module
redis.module
<?php
/**
* @file
* Redis module.
*
* This file is a placeholder for other modules that need the Redis client for
* something else than lock and cache.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function redis_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.redis':
$factory = \Drupal::service('redis.factory');
if ($factory->hasClient()) {
$messages = '<p><strong>' . t("Current connected client uses the <em>@name</em> library.", ['@name' => $factory->getClientName()]) . '</strong></p>';
}
else {
$messages = '<p><strong>' . t('No redis connection configured.') . '</strong></p>';
}
return $messages;
}
}
