3
サードパーティのAPIを呼び出すBundleを作成しました。Symfony Profilerのログデータ
これで、受信したデータをSymfony Profilerに表示します。
私はCustomDataCollector(http://symfony.com/doc/current/profiler/data_collector.html)を作成しました。それはすべて正常に動作します。しかし、どうやって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' ];
}