2017-07-15 19:01:21 +02:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
2017-09-26 11:11:59 +02:00
|
|
|
$possibleAutoloadPaths = [
|
2017-11-04 13:27:36 +01:00
|
|
|
// repository
|
|
|
|
__DIR__ . '/../vendor/autoload.php',
|
|
|
|
// composer require
|
|
|
|
__DIR__ . '/../../../../vendor/autoload.php',
|
2018-01-14 11:16:40 -02:00
|
|
|
// load from nearest vendor
|
|
|
|
getcwd() . '/vendor/autoload.php',
|
2017-09-26 11:11:59 +02:00
|
|
|
];
|
2017-07-15 19:01:21 +02:00
|
|
|
|
|
|
|
foreach ($possibleAutoloadPaths as $possibleAutoloadPath) {
|
|
|
|
if (is_file($possibleAutoloadPath)) {
|
|
|
|
require_once $possibleAutoloadPath;
|
2018-02-16 12:36:48 +01:00
|
|
|
return;
|
2017-07-15 19:01:21 +02:00
|
|
|
}
|
|
|
|
}
|
2018-02-16 12:36:48 +01:00
|
|
|
|
2018-02-17 12:50:11 +01:00
|
|
|
die(sprintf(
|
2018-02-23 18:22:42 +01:00
|
|
|
'Composer autoload.php was not found in paths "%s". Have you ran "composer update"?',
|
2018-02-16 12:36:48 +01:00
|
|
|
implode('", "', $possibleAutoloadPaths)
|
|
|
|
));
|