我正在使用symfony/dependency-injection组件(注意:不使用完整的堆栈框架)
在注册新服务时,我想在构造函数中注入一个类的新实例.例:
$container->register('session', 'Vendor\Core\Session')
->addArgument(new PhpBridgeSessionStorage());
Run Code Online (Sandbox Code Playgroud)
该示例非常有效,但如果我想使用yml文件来定义此服务该怎么办?就像是:
services:
session:
class: Vendor\Core\Session
arguments: [ new Class\To\Inject ]
Run Code Online (Sandbox Code Playgroud)
我是否被迫将Class\To\Inject定义为新服务?或者创建一个服务工厂?
我对New Relic如何跟踪php应用程序中的错误感到有点困惑.
应用程序中设置的错误级别(使用error_reporting())是否与php代理有关?还是它仍然得到所有错误?是否存在php代理无法收集错误的情况?