rest.install 851 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the rest module.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function rest_requirements($phase) {
  10. $requirements = array();
  11. if (version_compare(PHP_VERSION, '5.6.0', '>=') && version_compare(PHP_VERSION, '7', '<') && ini_get('always_populate_raw_post_data') != -1) {
  12. $requirements['always_populate_raw_post_data'] = array(
  13. 'title' => t('always_populate_raw_post_data PHP setting'),
  14. 'value' => t('Not set to -1.'),
  15. 'severity' => REQUIREMENT_ERROR,
  16. 'description' => t('The always_populate_raw_post_data PHP setting should be set to -1 in PHP version 5.6. Please check the <a href="https://php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data">PHP manual</a> for information on how to correct this.'),
  17. );
  18. }
  19. return $requirements;
  20. }