Пример #1
0
 /**
  * setResponseCode
  * 
  * @method setResponseCode
  * @param {int} $response_code 
  */
 public static function setResponseCode($response_code)
 {
     if (self::$_headers !== null) {
         self::$_headers = array();
     }
     $text = self::getTextByResponseCode($response_code);
     $protocol = $_SERVER['SERVER_PROTOCOL'];
     if ('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol) {
         $protocol = 'HTTP/1.1';
     }
     $value = $protocol . ' ' . $response_code . ' ' . $text;
     self::$_headers[] = array('value' => $value, 'response_code' => $response_code);
 }