You are here

brightcove.install in Brightcove Video Connect 6

Installation file for Brightcove module.

File

brightcove.install
View source
<?php

/**
 * @file
 * Installation file for Brightcove module.
 */

/**
 * Implementation of hook_requirements().
 */
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;
}

Functions

Namesort descending Description
brightcove_requirements Implementation of hook_requirements().