ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilWACDummyHeader Class Reference

Class ilWACDummyHeader. More...

+ Inheritance diagram for ilWACDummyHeader:
+ Collaboration diagram for ilWACDummyHeader:

Public Member Functions

 sendHeader ($string, $replace=true, $http_response_code=null)
 
 sendStatusCode ($name)
 
 headerExists ($name)
 
 getSentHeaders ()
 

Static Public Member Functions

static clear ()
 

Static Protected Attributes

static $sent_headers = array()
 
static $status_code = 0
 

Detailed Description

Member Function Documentation

◆ clear()

static ilWACDummyHeader::clear ( )
static

Definition at line 75 of file class.ilWACDummyHeader.php.

References array.

Referenced by ilWACCheckingInstanceTest\testBasicWithFileSigning(), and ilWACCheckingInstanceTest\testBasicWithFolderSigning().

75  {
76  self::$sent_headers = array();
77  self::$status_code = 0;
78  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getSentHeaders()

ilWACDummyHeader::getSentHeaders ( )
Returns
array

Implements ilWACHeaderInterface.

Definition at line 70 of file class.ilWACDummyHeader.php.

70  {
71  return self::$sent_headers;
72  }

◆ headerExists()

ilWACDummyHeader::headerExists (   $name)
Parameters
$name
Returns
bool

Implements ilWACHeaderInterface.

Definition at line 62 of file class.ilWACDummyHeader.php.

62  {
63  return in_array($name, self::$sent_headers);
64  }

◆ sendHeader()

ilWACDummyHeader::sendHeader (   $string,
  $replace = true,
  $http_response_code = null 
)
Parameters
$string
bool$replace
null$http_response_code

Implements ilWACHeaderInterface.

Definition at line 26 of file class.ilWACDummyHeader.php.

References sendStatusCode().

26  {
27  preg_match("/(?P<key>.*):(?P<value>.*)/um", $string, $matches);
28 
29  $replaced = false;
30  if ($replace) {
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']) {
34  $replaced = true;
35  self::$sent_headers[$i] = $string;
36  break;
37  }
38  }
39  }
40  if (!$replaced || $replace) {
41  self::$sent_headers[] = $string;
42  }
43 
44  if ($http_response_code) {
45  $this->sendStatusCode($http_response_code);
46  }
47  }
+ Here is the call graph for this function:

◆ sendStatusCode()

ilWACDummyHeader::sendStatusCode (   $name)
Parameters
$name

Implements ilWACHeaderInterface.

Definition at line 53 of file class.ilWACDummyHeader.php.

Referenced by sendHeader().

53  {
54  self::$status_code = $name;
55  }
+ Here is the caller graph for this function:

Field Documentation

◆ $sent_headers

ilWACDummyHeader::$sent_headers = array()
staticprotected

Definition at line 14 of file class.ilWACDummyHeader.php.

◆ $status_code

ilWACDummyHeader::$status_code = 0
staticprotected

Definition at line 18 of file class.ilWACDummyHeader.php.


The documentation for this class was generated from the following file: