Exemplo n.º 1
0
 /**
  * Get response status header string
  */
 public static function getHeader($scheme = 'HTTP/1.1', $code = 200)
 {
     $scheme = strtoupper(Sanitize::toText($scheme));
     $code = Sanitize::toNumber($code);
     $info = self::getString($code);
     return $scheme . ' ' . $code . ' ' . $info;
 }
Exemplo n.º 2
0
 /**
  * Sets the HTTP status code
  */
 public function setStatusCode($value = 200)
 {
     $value = Sanitize::toNumber($value);
     if (!empty($value) && $value > 99 && $value < 999) {
         $this->status = $value;
     }
 }
Exemplo n.º 3
0
 /**
  * Get the port number
  */
 public static function getPort()
 {
     $value = Utils::getValue(@$_SERVER['SERVER_PORT'], 0);
     $value = Sanitize::toNumber($value);
     return $value;
 }