redis.module 752 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @file
  4. * Redis module.
  5. *
  6. * This file is a placeholder for other modules that need the Redis client for
  7. * something else than lock and cache.
  8. */
  9. use Drupal\Core\Routing\RouteMatchInterface;
  10. use Drupal\redis\ClientFactory;
  11. /**
  12. * Implements hook_help().
  13. */
  14. function redis_help($route_name, RouteMatchInterface $route_match) {
  15. switch ($route_name) {
  16. case 'help.page.redis':
  17. if (ClientFactory::hasClient()) {
  18. $messages = '<p><strong>' . t("Current connected client uses the <em>@name</em> library.", ['@name' => ClientFactory::getClientName()]) . '</strong></p>';
  19. }
  20. else {
  21. $messages = '<p><strong>' . t('No redis connection configured.') . '</strong></p>';
  22. }
  23. return $messages;
  24. }
  25. }