我正在尝试使用Guzzle(v6)从PHP客户端对API服务器发出的请求进行分析。
在Guzzle 5.3中有complete
和before
事件处理功能。
class GuzzleProfiler implements SubscriberInterface
{
public function getEvents()
{
return [
'before' => ['onBefore'],
'complete' => ['onComplete']
];
}
public function onBefore(BeforeEvent $event, $name)
{
start_profiling();
}
public function onComplete(CompleteEvent $event, $name)
{
end_profiling();
}
}
但是在v6中我该怎么做呢?