Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created October 15, 2013 17:48
Show Gist options
  • Save alnutile/6995647 to your computer and use it in GitHub Desktop.
Save alnutile/6995647 to your computer and use it in GitHub Desktop.
Composer Manager
/**
* Registers the autoloader for all third-party packages.
*/
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment