You are here

function brightcove_mapi_path in Brightcove Video Connect 7.2

Same name and namespace in other branches
  1. 6.2 brightcove.module \brightcove_mapi_path()
  2. 6 brightcove.module \brightcove_mapi_path()
  3. 7.3 brightcove.module \brightcove_mapi_path()
  4. 7.4 brightcove.module \brightcove_mapi_path()
  5. 7.5 brightcove.module \brightcove_mapi_path()

Return the path to the Brightcove MAPI library.

If brightcove_variable_get('brightcove_mapi_path') has not yet been set, then this will attempt to autodiscover the path if the bc-mapi.php file exists within sites/all/libraries/* or sites/example.com/libraries/*. It will also set the path to media_brightcove_variable_get('brightcove_mapi_path').

The library is available from http://opensource.brightcove.com/project/PHP-MAPI-Wrapper/.

Return value

string The path to the bc-mapi.php file.

1 call to brightcove_mapi_path()
brightcove_initialize in ./brightcove.module
Initializes the Brightcove Media API and returns an instance of the object.
2 string references to 'brightcove_mapi_path'
brightcove_requirements in ./brightcove.install
Implementation of hook_requirements().
brightcove_uninstall in ./brightcove.install
Implements hook_uninstall().

File

./brightcove.module, line 131
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_mapi_path() {
  $path =& drupal_static(__FUNCTION__);
  if (!isset($path)) {
    if (!($path = variable_get('brightcove_mapi_path', FALSE))) {
      $files = drupal_system_listing('/^bc-mapi\\.php$/', 'libraries', 'filename', 0);
      if (isset($files['bc-mapi.php'])) {
        $path = dirname($files['bc-mapi.php']->uri);
        variable_set('brightcove_mapi_path', $path);
      }
    }
  }
  return $path;
}