-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathphpactor
More file actions
executable file
·46 lines (37 loc) · 1.05 KB
/
phpactor
File metadata and controls
executable file
·46 lines (37 loc) · 1.05 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
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Phpactor\Application;
use Composer\XdebugHandler\XdebugHandler;
foreach ([
__DIR__ . '/../../../autoload.php',
__DIR__ . '/../vendor/autoload.php'
] as $file) {
if (file_exists($file)) {
$autoloadFile = $file;
break;
}
}
ini_set('display_errors', 'stderr');
if (!isset($autoloadFile)) {
echo sprintf(
'Phpactor dependencies not installed. Run `composer install` (https://getcomposer.org) in "%s"' . PHP_EOL,
realpath(__DIR__ . '/..')
);
exit(255);
}
$minVersion = '7.3.0';
if (version_compare(PHP_VERSION, $minVersion) < 0) {
echo sprintf('Phpactor requires at least PHP %s', $minVersion) . PHP_EOL;
exit(255);
}
require_once $autoloadFile;
$application = new Application(realpath(dirname($autoloadFile)));
$output = new ConsoleOutput();
try {
$application->run(null, $output);
} catch (Exception $e) {
$application->renderException($e, $output);
exit(255);
}