mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-31 20:51:46 +01:00
19 lines
517 B
PHP
19 lines
517 B
PHP
<?php declare(strict_types=1);
|
|
|
|
/**
|
|
* This allows to load "vendor/autoload.php" both from
|
|
* "composer create-project ..." and "composer require" installation.
|
|
*/
|
|
$possibleAutoloadPaths = [
|
|
__DIR__ . '/../vendor/autoload.php', // composer require ... | repository
|
|
__DIR__ . '/../../../vendor/autoload.php' // composer create-project
|
|
];
|
|
|
|
foreach ($possibleAutoloadPaths as $possibleAutoloadPath) {
|
|
if (is_file($possibleAutoloadPath)) {
|
|
require_once $possibleAutoloadPath;
|
|
|
|
break;
|
|
}
|
|
}
|