-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeamon.php
More file actions
24 lines (23 loc) · 772 Bytes
/
deamon.php
File metadata and controls
24 lines (23 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/php
<?php
declare(strict_types=1);
set_time_limit(0);
use Core\Cache\Memcached;
use Core\Deamon\Bootstrap;
use Core\Deamon\Serial;
use Core\Config\Config;
use Core\Protocol\Socket\Client;
use Modules\Internal\RealtimeDistributor;
require_once(__DIR__ . '/../../vendor/autoload.php');
$register = include (__DIR__ . '/../Modules/register.php');
try {
$bootstrap = new Bootstrap(
new Serial(Config::getSerialDevice()),
(new Memcached(Config::getMemcacheHost(), Config::getMemcachePort()))->clear(),
new Client(Config::getSocketServerHost(), Config::getSocketServerPort()),
$register[RealtimeDistributor::class]()
);
$bootstrap->run();
} catch (Exception $e) {
echo "Memcached Error: " . $e->getMessage() . "\n";
}