You are here

function oauth2_server_get_library_path in OAuth2 Server 7

Returns the filesystem path to the oauth2-server-php library.

3 calls to oauth2_server_get_library_path()
oauth2_server_init in ./oauth2_server.module
Implements hook_init().
oauth2_server_requirements in ./oauth2_server.install
Implements hook_requirements().
oauth2_server_xautoload in ./oauth2_server.module
Implements hook_xautoload().

File

./oauth2_server.module, line 44
Provides OAuth2 server functionality.

Code

function oauth2_server_get_library_path() {
  $path = 'sites/all/libraries/oauth2-server-php';

  // The testbot installs dependencies listed in composer.json in vendor instead
  // of sites/all/libraries.
  if (!file_exists($path) && file_exists(DRUPAL_ROOT . '/vendor/bshaffer/oauth2-server-php')) {
    $path = DRUPAL_ROOT . '/vendor/bshaffer/oauth2-server-php';
  }

  // If installed, use the Libraries API to locate the library.
  if (module_exists('libraries')) {
    module_load_include('module', 'libraries');
    $path = libraries_get_path('oauth2-server-php');
  }
  return $path;
}