1 | <?php |
||
20 | class Header extends Header\ContentType |
||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private static $userAgent; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private static $IfModifiedSince; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private static $IfNoneMatch; |
||
36 | |||
37 | /** |
||
38 | * @param string $userAgent |
||
39 | * @param string $IfModifiedSince |
||
40 | * @param string $IfNoneMatch |
||
41 | */ |
||
42 | public static function edge($userAgent, $IfModifiedSince, $IfNoneMatch) |
||
48 | |||
49 | /** |
||
50 | * Removes previously set headers. |
||
51 | */ |
||
52 | public static function clear() |
||
60 | |||
61 | /** |
||
62 | * @param string $url |
||
63 | * @param boolean $exit |
||
64 | */ |
||
65 | public static function toLocation($url, $exit = true) |
||
72 | |||
73 | /** |
||
74 | * @param int $code |
||
75 | * @param string $status |
||
76 | * @param boolean $exit |
||
77 | */ |
||
78 | protected static function view($code, $status, $exit = true) |
||
106 | |||
107 | /** |
||
108 | * @param string $msg |
||
109 | * @param boolean $exit |
||
110 | */ |
||
111 | public static function sendInternalServerError($msg = '', $exit = true) |
||
115 | |||
116 | /** |
||
117 | * @param string $msg |
||
118 | * @param boolean $exit |
||
119 | */ |
||
120 | public static function sendNotFound($msg = '', $exit = true) |
||
124 | |||
125 | /** |
||
126 | * Handles setting pages that are always to be revalidated for freshness by any cache. |
||
127 | * |
||
128 | * @param int $last_modified Timestamp in seconds |
||
129 | */ |
||
130 | public static function exitIfNotModifiedSince($last_modified) |
||
141 | |||
142 | /** |
||
143 | * Actual HTTP caching validation. |
||
144 | * |
||
145 | * @param int $mtime In seconds |
||
146 | * @param string $etag |
||
147 | * |
||
148 | * @return bool |
||
149 | */ |
||
150 | public static function isModified($mtime, $etag = '') |
||
156 | |||
157 | /** |
||
158 | * If you want to allow a page to be cached by shared proxies for one minute. |
||
159 | * |
||
160 | * @param int $seconds Interval in seconds |
||
161 | */ |
||
162 | public static function cacheNoValidate($seconds = 60) |
||
168 | |||
169 | /** |
||
170 | * If instead you have a page that has personalization on it |
||
171 | * (say, for example, the splash page contains local news as well), |
||
172 | * you can set a copy to be cached only by the browser. |
||
173 | * |
||
174 | * @param int $seconds Interval in seconds |
||
175 | */ |
||
176 | public static function cacheBrowser($seconds = 60) |
||
182 | |||
183 | private static function cachePage($seconds) |
||
192 | |||
193 | |||
194 | /** |
||
195 | * If you want to try as hard as possible to keep a page from being cached anywhere. |
||
196 | */ |
||
197 | public static function cacheNone() |
||
205 | |||
206 | /** |
||
207 | * Sends file as download-header through any firewall to the browsers like >=IE6 >=FF3.6, Safari, Chrome, Opera. |
||
208 | * |
||
209 | * @link http://reeg.junetz.de/DSP/node16.html |
||
210 | * @link http://www.php.net/manual/de/function.header.php#88038 |
||
211 | * |
||
212 | * @param string $fileOrString |
||
213 | * @param string $fileName |
||
214 | * @param boolean $exit Optional for testing |
||
215 | */ |
||
216 | public static function sendDownloadDialog($fileOrString, $fileName, $exit = true) |
||
236 | } |
||
237 |