webman-php / gateway-worker Goto Github PK
View Code? Open in Web Editor NEWwebman gateway-worker plugin
Home Page: https://www.workerman.net/webman
License: MIT License
webman gateway-worker plugin
Home Page: https://www.workerman.net/webman
License: MIT License
webman 重启后(reload),且 gateway =>reloadable=>false , 按道理这种设置 是不会重启gateway的
环境:
windows
错误:
ErrorException: Undefined index: file
复现:
直接执行 windows 下生成的 runtime/windows/xxx.php 文件(运行 php windows.php 同样触发问题)
示例代码如下:
<?php
require_once __DIR__ . '/../../vendor/autoload.php';
use Workerman\Worker;
use Webman\Config;
use support\App;
ini_set('display_errors', 'on');
error_reporting(E_ALL);
if (is_callable('opcache_reset')) {
opcache_reset();
}
App::loadAllConfig(['route']);
worker_start('plugin.webman.gateway-worker.gateway', config('plugin.webman.gateway-worker.process')['gateway']);
if (DIRECTORY_SEPARATOR != "/") {
Worker::$logFile = config('server')['log_file'] ?? Worker::$logFile;
}
Worker::runAll();
系统:windows7
PHP版本:7.3
webman版本:1.2.4
当使用 webman/casbin 插件和 webman/gateway-worker插件时,会报 DI\Definition\Exception\InvalidDefinition: Entry "Webman\GatewayWorker\BusinessWorker" cannot be resolved: Parameter $config of __construct() has no value defined or guessable 错误
两者插件不在同一个项目中使用,可以正常运行,两者插件都是默认配置信息
DI\Definition\Exception\InvalidDefinition: Entry "Webman\GatewayWorker\BusinessWorker" cannot be resolved: Parameter $config of __construct() has no value defined or guessable Full definition: Object ( class = Webman\GatewayWorker\BusinessWorker lazy = false __construct( $config = #UNDEFINED# ) ) in G:\workerman\midou\vendor\php-di\php-di\src\Definition\Exception\InvalidDefinition.php:19 Stack trace: #0 G:\workerman\midou\vendor\php-di\php-di\src\Definition\Resolver\ObjectCreator.php(156): DI\Definition\Exception\InvalidDefinition::create(Object(DI\Definition\ObjectDefinition), 'Entry "Webman\\G...') #1 G:\workerman\midou\vendor\php-di\php-di\src\Definition\Resolver\ObjectCreator.php(71): DI\Definition\Resolver\ObjectCreator->createInstance(Object(DI\Definition\ObjectDefinition), Array) #2 G:\workerman\midou\vendor\php-di\php-di\src\Definition\Resolver\ResolverDispatcher.php(71): DI\Definition\Resolver\ObjectCreator->resolve(Object(DI\Definition\ObjectDefinition), Array) #3 G:\workerman\midou\vendor\php-di\php-di\src\Container.php(390): DI\Definition\Resolver\ResolverDispatcher->resolve(Object(DI\Definition\ObjectDefinition), Array) #4 G:\workerman\midou\vendor\php-di\php-di\src\Container.php(199): DI\Container->resolveDefinition(Object(DI\Definition\ObjectDefinition), Array) #5 G:\workerman\midou\support\Container.php(50): DI\Container->make('Webman\\GatewayW...', Array) #6 G:\workerman\midou\support\helpers.php(387): support\Container::__callStatic('make', Array) #7 G:\workerman\midou\vendor\workerman\workerman\Worker.php(2404): {closure}(Object(Workerman\Worker)) #8 G:\workerman\midou\vendor\workerman\workerman\Worker.php(1416): Workerman\Worker->run() #9 G:\workerman\midou\vendor\workerman\workerman\Worker.php(1359): Workerman\Worker::forkWorkersForWindows() #10 G:\workerman\midou\vendor\workerman\workerman\Worker.php(549): Workerman\Worker::forkWorkers() #11 G:\workerman\midou\runtime\windows\start_worker.php(13): Workerman\Worker::runAll() #12 {main} PHP Fatal error: Uncaught Error: Call to undefined function posix_getpid() in G:\workerman\midou\vendor\workerman\workerman\Worker.php:1830 Stack trace: #0 G:\workerman\midou\vendor\workerman\workerman\Worker.php(2408): Workerman\Worker::stopAll(250, Object(DI\Definition\Exception\InvalidDefinition)) #1 G:\workerman\midou\vendor\workerman\workerman\Worker.php(1416): Workerman\Worker->run() #2 G:\workerman\midou\vendor\workerman\workerman\Worker.php(1359): Workerman\Worker::forkWorkersForWindows() #3 G:\workerman\midou\vendor\workerman\workerman\Worker.php(549): Workerman\Worker::forkWorkers() #4 G:\workerman\midou\runtime\windows\start_worker.php(13): Workerman\Worker::runAll()
这是错误信息截取
Webman\GatewayWorker\Register::class类初始化方法为空实现
导致注册中心secretKey特性缺失。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.