-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathswiss-knife.php
executable file
·37 lines (29 loc) · 1016 Bytes
/
swiss-knife.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Rector\SwissKnife\DependencyInjection\ContainerFactory;
$possibleAutoloadPaths = [
// dependency
__DIR__ . '/../../../autoload.php',
// after split package
__DIR__ . '/../vendor/autoload.php',
// monorepo
__DIR__ . '/../../../vendor/autoload.php',
];
foreach ($possibleAutoloadPaths as $possibleAutoloadPath) {
if (file_exists($possibleAutoloadPath)) {
require_once $possibleAutoloadPath;
break;
}
}
$scoperAutoloadFilepath = __DIR__ . '/../vendor/scoper-autoload.php';
if (file_exists($scoperAutoloadFilepath)) {
require_once $scoperAutoloadFilepath;
}
$containerFactory = new ContainerFactory();
$container = $containerFactory->create();
$application = $container->make(Application::class);
$exitCode = $application->run(new ArgvInput(), new ConsoleOutput());
exit($exitCode);