easyswoole 热重启

composer安装

composer require easyswoole/hot-reload

在EasySwooleEvent.php中

class EasySwooleEvent {

    public static function mainServerCreate(EventRegister $register)
    {
        $hotReloadOptions = new \EasySwoole\HotReload\HotReloadOptions;
        $hotReload = new \EasySwoole\HotReload\HotReload($hotReloadOptions);
        $hotReloadOptions->setMonitorFolder([EASYSWOOLE_ROOT . '/App']);
        $server = ServerManager::getInstance()->getSwooleServer();
        $hotReload->attachToServer($server);
    }
}

你可能感兴趣的:(easyseoole,php)