Open webdick opened 9 months ago
是要将 config/container.php 中的 return new Webman\Container; 替换成 $builder = new \DI\ContainerBuilder(); $builder->addDefinitions(config('dependence', [])); $builder->useAutowiring(true); return $builder->build(); 吗
return new Webman\Container;
$builder = new \DI\ContainerBuilder(); $builder->addDefinitions(config('dependence', [])); $builder->useAutowiring(true); return $builder->build();
是的。按照 https://www.workerman.net/doc/webman/di.html 这个配置即可
是要将 config/container.php 中的
return new Webman\Container;
替换成$builder = new \DI\ContainerBuilder(); $builder->addDefinitions(config('dependence', [])); $builder->useAutowiring(true); return $builder->build();
吗