variable_advanced.variable.inc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * @file
  4. * Advanced variables.
  5. */
  6. /**
  7. * Implements hook_variable_group_info().
  8. */
  9. function variable_advanced_variable_group_info() {
  10. $groups['advanced'] = array(
  11. 'title' => t('Advanced options'),
  12. 'description' => t('Advanced settings not usually exposed. Changing these variables may seriously break your site so make sure you know what you do.'),
  13. );
  14. return $groups;
  15. }
  16. /**
  17. * Implements hook_variable_info().
  18. */
  19. function variable_advanced_variable_info($options) {
  20. // Bootstrap caching options
  21. $variables['page_cache_invoke_hooks'] = array(
  22. 'title' => t('Cache invoke hooks'),
  23. 'type' => 'enable',
  24. 'default' => 1,
  25. 'group' => 'advanced',
  26. 'description' => T('Invoke <em>boot</em> and <em>exit</em> hooks when the page is served from cache.'),
  27. );
  28. $variables['actions_max_stack'] = array(
  29. 'title' => t('Actions recursion level'),
  30. 'type' => 'number',
  31. 'default' => 35,
  32. 'group' => 'advanced',
  33. 'description' => t('Maximum recursion level for actions before the execution is aborted.', array(), $options),
  34. );
  35. // Bootstrap language variables.
  36. $variables['language_count'] = array(
  37. 'title' => t('Language count'),
  38. 'type' => 'number',
  39. 'default' => 1,
  40. 'group' => 'advanced',
  41. 'description' => t('Number of enabled languages, used for quick bootstrap. Not to be changed manually.', array(), $options),
  42. );
  43. $variables['language_types'] = array(
  44. 'title' => t('Language types'),
  45. 'type' => 'array',
  46. 'default callback' => 'drupal_language_types',
  47. 'group' => 'advanced',
  48. 'description' => t('Available language types.'),
  49. );
  50. // Bootstrap proxy configuration
  51. $variables['reverse_proxy'] = array(
  52. 'title' => t('Reverse proxy'),
  53. 'type' => 'enable',
  54. 'default' => 0,
  55. 'group' => 'advanced',
  56. 'description' => t('If Drupal is behind a reverse proxy, we use the X-Forwarded-For header instead of $_SERVER[\'REMOTE_ADDR\'], which would be the IP address of the proxy server, and not the client\'s. The actual header name can be configured by the reverse_proxy_header variable.', array(), $options),
  57. );
  58. $variables['reverse_proxy_header'] = array(
  59. 'title' => t('Reverse proxy header'),
  60. 'default' => 'HTTP_X_FORWARDED_FOR',
  61. 'group' => 'advanced',
  62. );
  63. $variables['reverse_proxy_addresses'] = array(
  64. 'title' => t('Reverse proxy addresses'),
  65. 'type' => 'array',
  66. 'group' => 'advanced',
  67. 'default' => array(),
  68. 'description' => t('If an array of known reverse proxy IPs is provided, then trust the XFF header if request really comes from one of them.', array(), $options),
  69. );
  70. return $variables;
  71. }