mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
21 lines
570 B
PHP
21 lines
570 B
PHP
<?php
|
|
|
|
// Init composer autoload
|
|
call_user_func(function () {
|
|
$candidates = [
|
|
// module in vendor
|
|
__DIR__ . '/../../../../autoload.php',
|
|
// module itself is webroot (usually during CI installs)
|
|
__DIR__ . '/../../vendor/autoload.php',
|
|
// fallback
|
|
getcwd() . '/vendor/autoload.php',
|
|
];
|
|
foreach ($candidates as $candidate) {
|
|
if (file_exists($candidate)) {
|
|
require_once $candidate;
|
|
return;
|
|
}
|
|
}
|
|
die("Failed to include composer's autoloader, unable to continue");
|
|
});
|