/** * 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; }
/** * Sets the HTTP status code */ public function setStatusCode($value = 200) { $value = Sanitize::toNumber($value); if (!empty($value) && $value > 99 && $value < 999) { $this->status = $value; } }
/** * Get the port number */ public static function getPort() { $value = Utils::getValue(@$_SERVER['SERVER_PORT'], 0); $value = Sanitize::toNumber($value); return $value; }