-
-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathphpactor
More file actions
executable file
·49 lines (39 loc) · 1.1 KB
/
Copy pathphpactor
File metadata and controls
executable file
·49 lines (39 loc) · 1.1 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Output\ConsoleOutput;
use Phpactor\Application;
foreach ([
__DIR__ . '/../../../autoload.php',
__DIR__ . '/../vendor/autoload.php'
] as $file) {
if (file_exists($file)) {
$autoloadFile = $file;
break;
}
}
if (!getenv('PHPACTOR_DEPRECATIONS')) {
error_reporting(\E_ALL^~\E_DEPRECATED^~\E_NOTICE);
}
ini_set('display_errors', 'stderr');
if (!isset($autoloadFile)) {
echo sprintf(
'Phpactor dependencies not installed. Run `composer install` (https://getcomposer.org) in "%s"' . "\n",
realpath(__DIR__ . '/..')
);
exit(255);
}
$minVersion = '8.2.0';
if (version_compare(PHP_VERSION, $minVersion) < 0) {
fwrite(STDERR, sprintf('Phpactor requires at least PHP %s', $minVersion) . "\n");
exit(255);
}
require_once $autoloadFile;
$phpactorBin = $argv[0];
$application = new Application(realpath(dirname($autoloadFile)), $phpactorBin);
$output = new ConsoleOutput();
try {
$application->run(null, $output);
} catch (Exception $e) {
$application->renderThrowable($e, $output);
exit(255);
}