You are here

function graphql_requirements in GraphQL 8.3

Same name and namespace in other branches
  1. 8.4 graphql.install \graphql_requirements()

Implements hook_requirements().

File

./graphql.install, line 6

Code

function graphql_requirements($phase) {

  // This is the first reference into the library performed by the module.
  $libraryAvailable = class_exists('\\GraphQL\\GraphQL');
  $libraryArg = [
    '@library' => 'webonyx/graphql-php',
  ];
  return [
    'graphql' => [
      'title' => 'GraphQL',
      'description' => !empty($libraryAvailable) ? t('@library component available', $libraryArg) : t('@library component not found', $libraryArg),
      'severity' => !empty($libraryAvailable) ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    ],
  ];
}