You are here

function composer_manager_register_autoloader in Composer Manager 6.2

Same name and namespace in other branches
  1. 6 composer_manager.module \composer_manager_register_autoloader()
  2. 7.2 composer_manager.module \composer_manager_register_autoloader()
  3. 7 composer_manager.module \composer_manager_register_autoloader()

Registers the autoloader for all third-party packages.

1 call to composer_manager_register_autoloader()
composer_manager_init in ./composer_manager.module
Implements hook_init().

File

./composer_manager.module, line 138
Provides consolidated management of third-party Composer-compatible packages required by contributed modules.

Code

function composer_manager_register_autoloader() {
  static $registered = FALSE;
  if (!$registered) {
    $autoloader = composer_manager_vendor_dir() . '/autoload.php';
    if (!file_exists($autoloader)) {
      $message = t('Autoloader not found: @file', array(
        '@file' => $autoloader,
      ));
      throw new \RuntimeException($message);
    }
    $registered = TRUE;
    require $autoloader;
  }
}