大佬,当使用依赖注入时,会报 DI\Definition\Exception\InvalidDefinition: Entry "Webman\GatewayWorker\BusinessWorker" cannot be resolved: Parameter $config of __construct() has no value defined or guessable 错误 #1
当使用 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:
PHP Fatal error: Uncaught Error: Call to undefined function posix_getpid() in G:\workerman\midou\vendor\workerman\workerman\Worker.php:1830
Stack trace:
系统: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()
`
这是错误信息截取