-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask1
executable file
·45 lines (37 loc) · 1.06 KB
/
task1
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
#!/usr/bin/env php
<?php
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}
if (version_compare('7.4.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
'This app is supported on PHP 7.4' . PHP_EOL .
'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINARY
)
);
die(1);
}
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) {
require $autoload;
} else {
fwrite(STDERR,
'You must set up the project dependencies, run the following commands:'.PHP_EOL.
'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
'php composer.phar install'.PHP_EOL
);
exit(1);
}
set_error_handler(function (
int $severity,
string $message,
string $file,
int $line
) {
throw new ErrorException($message, 0, $severity, $file, $line);
});
$factory = new \Task1\ApplicationFactory();
$factory->createApplication()->run();