You are here

function brightcove_requirements in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 brightcove.install \brightcove_requirements()
  2. 6.2 brightcove.install \brightcove_requirements()
  3. 6 brightcove.install \brightcove_requirements()
  4. 7.7 brightcove.install \brightcove_requirements()
  5. 7.2 brightcove.install \brightcove_requirements()
  6. 7.3 brightcove.install \brightcove_requirements()
  7. 7.4 brightcove.install \brightcove_requirements()
  8. 7.5 brightcove.install \brightcove_requirements()
  9. 7.6 brightcove.install \brightcove_requirements()
  10. 3.x brightcove.install \brightcove_requirements()

Implements hook_requirements().

File

./brightcove.install, line 83
Brightcove install file.

Code

function brightcove_requirements($phase) {
  $requirements = [];
  $requirements['brightcove'] = [
    'title' => 'Brightcove API',
  ];

  // Check for API availability.
  if (!class_exists('Brightcove\\API\\API')) {
    $requirements['brightcove'] += [
      'description' => t('Missing Brightcove API from the vendor folder.'),
      'severity' => REQUIREMENT_ERROR,
    ];
  }

  // If everything passes show that the Brightcove API is installed
  // successfully.
  if (!isset($requirements['severity']) || $requirements['severity'] == REQUIREMENT_OK) {
    $requirements['brightcove'] += [
      'description' => t('Installed'),
      'severity' => REQUIREMENT_OK,
    ];
  }
  return $requirements;
}