Example #1
0
<?php

use Swoole\Entrance;
define('NOW_TIME', time());
$config = array('server_mode' => 'Socket', 'app_path' => 'app', 'ctrl_path' => 'ctrl', 'socket' => array('host' => '0.0.0.0', 'port' => 8888, 'socket_adapter' => 'Swoole', 'client_class' => 'socket\\Server', 'daemonize' => 0, 'work_mode' => 3, 'worker_num' => 8, 'max_request' => 10000, 'dispatch_mode' => 2, 'task_worker_num' => 8, 'open_length_check' => true, 'package_length_offset' => 0, 'package_body_offset' => 4, 'package_length_type' => 'N'));
$publicConfig = array('redis.php');
foreach ($publicConfig as $file) {
    $file = Entrance::getRootPath() . DS . 'config' . DS . 'public' . DS . $file;
    $config += (include "{$file}");
}
return $config;
Example #2
0
<?php

use Swoole\Entrance;
$rootPath = __DIR__;
require $rootPath . DIRECTORY_SEPARATOR . 'Swoole' . DIRECTORY_SEPARATOR . 'Entrance.php';
Entrance::run($rootPath);