You are here

function brightcove_requirements in Brightcove Video Connect 6

Same name and namespace in other branches
  1. 8.2 brightcove.install \brightcove_requirements()
  2. 8 brightcove.install \brightcove_requirements()
  3. 6.2 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()

Implementation of hook_requirements().

File

./brightcove.install, line 11
Installation file for Brightcove module.

Code

function brightcove_requirements($phase) {
  global $base_url;
  $requirements = array();
  $t = get_t();
  if (!($path = variable_get('brightcove_mapi_path', FALSE)) || $reset) {
    $files = drupal_system_listing('^bc-mapi\\.php$', 'libraries', 'basename', 0);
    if (isset($files['bc-mapi.php'])) {
      $path = dirname($files['bc-mapi.php']->filename);
      variable_set('brightcove_mapi_path', $path);
    }
  }
  if (!function_exists('curl_init')) {
    $requirements['curl']['title'] = $t('cURL');
    $requirements['curl']['description'] = $t('Brightcove MAPI SDK requires a cURL library. You should install it on your server.');
    $requirements['curl']['severity'] = REQUIREMENT_ERROR;
    $requirements['curl']['value'] = $t(': missing');
  }
  if (!$path) {
    $requirements['bc_mapi']['title'] = $t('Brightcove MAPI SDK');
    $requirements['bc_mapi']['description'] = $t('Brightcove MAPI SDK is missing. Please install it from !url.', array(
      '!url' => l('http://opensource.brightcove.com/project/PHP-MAPI-Wrapper/', 'http://opensource.brightcove.com/project/PHP-MAPI-Wrapper/'),
    ));
    $requirements['bc_mapi']['severity'] = REQUIREMENT_ERROR;
    $requirements['bc_mapi']['value'] = $t('Missing');
  }
  else {
    $requirements['bc_mapi']['title'] = $t('Brightcove MAPI SDK');
    $requirements['bc_mapi']['severity'] = REQUIREMENT_OK;
    $requirements['bc_mapi']['value'] = $t('Installed');
  }
  return $requirements;
}