2require_once(
'./Services/WebAccessChecker/interfaces/interface.ilWACHeaderInterface.php');
26 public function sendHeader($string, $replace =
true, $http_response_code =
null) {
27 preg_match(
"/(?P<key>.*):(?P<value>.*)/um", $string, $matches);
31 foreach (self::$sent_headers as $i => $sent_header) {
32 preg_match(
"/(?P<key>.*):(?P<value>.*)/um", $sent_header, $m);
33 if ($m[
'key'] == $matches[
'key']) {
35 self::$sent_headers[$i] = $string;
40 if (!$replaced || $replace) {
41 self::$sent_headers[] = $string;
44 if ($http_response_code) {
54 self::$status_code = $name;
63 return in_array($name, self::$sent_headers);
75 public static function clear() {
76 self::$sent_headers = array();
77 self::$status_code = 0;
An exception for terminatinating execution or to throw for unit testing.