rector/bin/bootstrap.php

30 lines
734 B
PHP
Raw Normal View History

2017-07-15 19:01:21 +02:00
<?php declare(strict_types=1);
2018-09-16 19:14:06 +02:00
$projectAutoload = getcwd() . '/vendor/autoload.php';
if (is_file($projectAutoload)) {
require $projectAutoload;
}
if (class_exists('Rector\DependencyInjection\RectorKernel')) {
return;
}
2017-09-26 11:11:59 +02:00
$possibleAutoloadPaths = [
// dev repository or prefixed rector
2017-11-04 13:27:36 +01:00
__DIR__ . '/../vendor/autoload.php',
// composer require
__DIR__ . '/../../../../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)) {
2018-09-16 19:14:06 +02:00
require $possibleAutoloadPath;
2018-05-28 17:34:39 +02:00
return;
2017-07-15 19:01:21 +02: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"?',
implode('", "', $possibleAutoloadPaths)
));