-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.php
42 lines (29 loc) · 1004 Bytes
/
main.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
38
39
40
41
42
<?php
declare(ticks=1);
define('AMQP_WITHOUT_SIGNALS', true);
require __DIR__.'/vendor/autoload.php';
if (class_exists('Phar')) {
$dir = dirname(\Phar::running(false));
}
if (empty($dir)) {
$dir = posix_getcwd();
}
$dir = realpath($dir);
if (file_exists($dir.'/vendor/autoload.php')) {
$loader = require $dir.'/vendor/autoload.php';
}
use Fazland\Rabbitd\Application\Application;
use Fazland\Rabbitd\Application\Kernel;
use Fazland\Rabbitd\Console\Environment;
use Symfony\Component\Debug\ErrorHandler;
set_time_limit(0);
if (! function_exists('pcntl_fork')) {
throw new \RuntimeException('pcntl_* functions are not available, cannot continue');
}
$errorHandler = ErrorHandler::register();
$errorHandler->throwAt(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_USER_WARNING, true);
$environment = Environment::createFromGlobal();
$kernel = new Kernel();
$kernel->getContainer()->set('environment', $environment);
$application = new Application($kernel);
$application->run();