Пример #1
0
 /**
  * Get all headers from Server environment
  * saves the headers array to static variable
  *
  * @return void
  */
 private static function parseRequestHeaders()
 {
     $headers = [];
     foreach ($_SERVER as $key => $value) {
         if (substr($key, 0, 5) != 'HTTP_') {
             continue;
         }
         $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
         $headers[$header] = $value;
     }
     self::$headers = $headers;
 }