-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwond
executable file
·34 lines (27 loc) · 929 Bytes
/
wond
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
#!/usr/bin/env php
<?php
use WondPHP\App;
use WondPHP\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use WondPHP\ErrorHandel;
if (false === 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;
}
set_time_limit(0);
require __DIR__.'/vendor/autoload.php';
$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}
if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}
define('BASE_PATH', __DIR__);
define('DEBUG',env('APP_DEBUG'));
if (DEBUG) {
umask(0000);
(new WondPHP\ErrorHandel());
}
$kernel = new App();
$application = new Application($kernel);
$application->run($input);