Created
October 15, 2013 17:48
-
-
Save alnutile/6995647 to your computer and use it in GitHub Desktop.
Composer Manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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