/**
  * @param Request|\Symfony\Component\HttpFoundation\Request $request
  *
  * @return array
  */
 protected function buildBasicEntry($request)
 {
     return ['api_key' => $request->query->get('api_key', $request->headers->get(ManagedDefaults::DF_API_KEY)), 'content_type' => $request->getContentType(), 'content_length' => (int) $request->headers->get('Content-Length', 0), 'dfe' => [], 'host' => $request->getHost(), 'method' => $request->getMethod(), 'path_info' => $request->getPathInfo(), 'path_translated' => $request->server->get('PATH_TRANSLATED'), 'query' => $request->query->all() ?: [], 'request_timestamp' => (double) $request->server->get('REQUEST_TIME_FLOAT', microtime(true)), 'source_ip' => $request->getClientIps(), 'user_agent' => $request->headers->get('user-agent', 'None')];
 }
Example #2
0
 /**
  * Gets the format associated with the request.
  *
  * @return string|null The format (null if no content type is present)
  * @static 
  */
 public static function getContentType()
 {
     //Method inherited from \Symfony\Component\HttpFoundation\Request
     return \Illuminate\Http\Request::getContentType();
 }