3
我創建了一個調用第三方api的Bundle。Symfony Profiler的日誌數據
現在我想在Symfony Profiler中顯示接收到的數據。
我創建了一個CustomDataCollector(http://symfony.com/doc/current/profiler/data_collector.html)。這一切都很好。但是,我如何獲得或「保存」接收到的API響應?
我創建了以這樣的捲曲調用API服務:
$raw_response = curl_exec($ch);
$response = json_decode($raw_response);
if (property_exists($response, 'error') && $response->errors) {
return ['status'=>false, 'msg'=> (string)$response->errors[0]->description ] ;
} else {
return ['status'=>true, 'msg' =>'Send Successfully' ];
}