Esempio n. 1
0
 private function responseCode()
 {
     if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
         http_response_code($this->status_code);
     } else {
         $status_msg = self::getStatusMessage($this->status_code);
         if ($status_msg === false) {
             die;
         }
         if (filter_input(INPUT_SERVER, 'FCGI_SERVER_VERSION') != null) {
             header('Status: ' . $this->status_code . ' ' . $status_msg);
         } else {
             $protocol = Request::getServerProtocol();
             header($protocol . ' ' . $this->status_code . ' ' . $status_msg);
         }
     }
 }