Mercurial > SimpleWebPresenter
comparison StatusCodes.inc @ 73:947d53f95ccd
Refactor Sitemap into a separate class.
Catch all exceptions in index.php and send a 500 error if nothing else
catches it.
Check response status before submitting to sitemap.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Fri, 12 Oct 2012 01:06:32 +0200 |
| parents | ba5afd9ff24e |
| children | 1d5166aba2c5 |
comparison
equal
deleted
inserted
replaced
| 72:7bc88fe62101 | 73:947d53f95ccd |
|---|---|
| 290 && // and not 204 NO CONTENT | 290 && // and not 204 NO CONTENT |
| 291 $code != self::HTTP_NO_CONTENT | 291 $code != self::HTTP_NO_CONTENT |
| 292 && // and not 304 NOT MODIFIED | 292 && // and not 304 NOT MODIFIED |
| 293 $code != self::HTTP_NOT_MODIFIED; | 293 $code != self::HTTP_NOT_MODIFIED; |
| 294 } | 294 } |
| 295 | |
| 296 /** | |
| 297 * | |
| 298 */ | |
| 299 public static function codeFromHeader($header) | |
| 300 { | |
| 301 $matches = array(); | |
| 302 preg_match('/HTTP\/\S+\s(\d+)/', $header, $matches); | |
| 303 $n = $matches[1]; | |
| 304 return $n; | |
| 305 } | |
| 295 } | 306 } |
| 296 ?> | 307 ?> |
