You are here

function rest_server_requirements in Services 6.3

Same name and namespace in other branches
  1. 7.3 servers/rest_server/rest_server.install \rest_server_requirements()

Implements hook_requirements().

File

servers/rest_server/rest_server.install, line 10
Install, uninstall and update the rest server module.

Code

function rest_server_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();
  if ($phase == 'runtime') {
    module_load_include('module', 'rest_server');
    module_load_include('module', 'libraries');
    if (_rest_server_get_spyc_location() === false) {
      $requirements['rest_server'] = array(
        'description' => 'The spyc library is missing, thus YAML is disabled',
        'severity' => REQUIREMENT_INFO,
        'value' => $t('To enable YAML HTTP requets/responses, please download <a href="@download">spyc</a> and create a file called spyc.php in rest_server/lib or use Libraries to retrieve spyc.', array(
          '@download' => 'http://code.google.com/p/spyc/downloads/list',
        )),
        'title' => t('Missing spyc library'),
      );
    }
  }
  return $requirements;
}