You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
846 B
PHP
25 lines
846 B
PHP
<?php
|
|
/**
|
|
* //TODO
|
|
* DateTime: 2019/8/28 13:52
|
|
* File: start.php
|
|
*/
|
|
|
|
use Workerman\Worker;
|
|
|
|
date_default_timezone_set('Asia/Shanghai');
|
|
require_once "workerman/Autoloader.php";
|
|
\Workerman\Autoloader::setRootPath(__DIR__);
|
|
//if (!extension_loaded('pcntl')) exit("Please install pcntl extension. See http://doc3.workerman.net/install/install.html\n");
|
|
//if (!extension_loaded('posix')) exit("Please install posix extension. See http://doc3.workerman.net/install/install.html\n");
|
|
|
|
$config = [];
|
|
$config['workerman']['pidFile'] = __DIR__ . '/logs/workerman.pid';
|
|
$config['workerman']['logFile'] = __DIR__ . '/logs/workerman.log';
|
|
Worker::$pidFile = $config['workerman']['pidFile'];
|
|
Worker::$logFile = $config['workerman']['logFile'];
|
|
foreach (glob(__DIR__ . '/bot/bot_*.php') as $start_file) {
|
|
require_once $start_file;
|
|
}
|
|
Worker::runAll();
|