mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 05:39:10 +02:00
Add Composer autoloader
Mainly to get PHPUnit going as a composer requirement rather than through PEAR (which is easier to set up).
This commit is contained in:
parent
0a580deb3f
commit
e4d71c2a20
@ -275,10 +275,16 @@ $flush = (isset($_GET['flush']) || isset($_REQUEST['url']) && (
|
|||||||
));
|
));
|
||||||
$manifest = new SS_ClassManifest(BASE_PATH, false, $flush);
|
$manifest = new SS_ClassManifest(BASE_PATH, false, $flush);
|
||||||
|
|
||||||
|
// Register SilverStripe's class map autoload
|
||||||
$loader = SS_ClassLoader::instance();
|
$loader = SS_ClassLoader::instance();
|
||||||
$loader->registerAutoloader();
|
$loader->registerAutoloader();
|
||||||
$loader->pushManifest($manifest);
|
$loader->pushManifest($manifest);
|
||||||
|
|
||||||
|
// Fall back to Composer's autoloader (e.g. for PHPUnit), if composer is used
|
||||||
|
if(file_exists(BASE_PATH . '/vendor/autoload.php')) {
|
||||||
|
require_once BASE_PATH . '/vendor/autoload.php';
|
||||||
|
}
|
||||||
|
|
||||||
// Now that the class manifest is up, load the configuration
|
// Now that the class manifest is up, load the configuration
|
||||||
$configManifest = new SS_ConfigManifest(BASE_PATH, false, $flush);
|
$configManifest = new SS_ConfigManifest(BASE_PATH, false, $flush);
|
||||||
Config::inst()->pushConfigManifest($configManifest);
|
Config::inst()->pushConfigManifest($configManifest);
|
||||||
|
Loading…
Reference in New Issue
Block a user