mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 10:43:35 +01:00
23 lines
589 B
PHP
23 lines
589 B
PHP
<?php declare(strict_types=1);
|
|
|
|
$possibleAutoloadPaths = [
|
|
// repository
|
|
__DIR__ . '/../vendor/autoload.php',
|
|
// composer require
|
|
__DIR__ . '/../../../../vendor/autoload.php',
|
|
// load from nearest vendor
|
|
getcwd() . '/vendor/autoload.php',
|
|
];
|
|
|
|
foreach ($possibleAutoloadPaths as $possibleAutoloadPath) {
|
|
if (is_file($possibleAutoloadPath)) {
|
|
require_once $possibleAutoloadPath;
|
|
return;
|
|
}
|
|
}
|
|
|
|
die(sprintf(
|
|
'Composer autoload.php was not found in paths "%s". Have you ran "composer update"?',
|
|
implode('", "', $possibleAutoloadPaths)
|
|
));
|