123456789101112131415161718192021222324252627282930313233 |
- <?php
- require_once __DIR__ . '/vendor/autoload.php';
- use Adapterman\Adapterman;
- use Workerman\Worker;
- use Workerman\Lib\Timer;
- Adapterman::init();
- $http_worker = new Worker('http://0.0.0.0:8080');
- $http_worker->count = (int) shell_exec('nproc') * 4;
- $http_worker->name = 'AdapterMan-Symfony';
- $http_worker->onWorkerStart = function () {
- Header::$date = gmdate('D, d M Y H:i:s').' GMT';
- Timer::add(1, function() {
- Header::$date = gmdate('D, d M Y H:i:s').' GMT';
- });
- //init();
- require __DIR__.'/start.php';
- };
- $http_worker->onMessage = static function ($connection, $request) {
- $connection->send(run());
- };
- Worker::runAll();
- class Header {
- public static $date;
- }
|