munin_apc.install 972 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * @file
  4. * Drupal APC instrumentation for Munin: installation.
  5. *
  6. * @copyright (c) 2011-2019 Ouest Systèmes Informatiques
  7. *
  8. * Licensed under the General Public License version 2 or later.
  9. */
  10. /**
  11. * Implements hook_enable().
  12. */
  13. function munin_apc_enable() {
  14. variable_set('menu_rebuild_needed', TRUE);
  15. }
  16. /**
  17. * Implements hook_disable().
  18. */
  19. function munin_apc_disable() {
  20. variable_set('menu_rebuild_needed', TRUE);
  21. }
  22. /**
  23. * Implements hook_requirements().
  24. *
  25. * Since this module requires PHP >= 7.1, the only suported version of APC is
  26. * actually APCu.
  27. */
  28. function munin_apc_requirements($phase) {
  29. $requirements = [];
  30. $t = get_t();
  31. if (!function_exists('apcu_sma_info') || !function_exists('apcu_cache_info')) {
  32. $requirements['munin_apc'] = [
  33. 'title' => $t('APCu'),
  34. 'description' => $t('APCu functions apc_sma_info / apcu_cache_info not found'),
  35. 'severity' => REQUIREMENT_ERROR,
  36. ];
  37. }
  38. return $requirements;
  39. }