diff 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
line wrap: on
line diff
--- a/StatusCodes.inc	Thu Oct 11 23:47:12 2012 +0200
+++ b/StatusCodes.inc	Fri Oct 12 01:06:32 2012 +0200
@@ -292,5 +292,16 @@
       && // and not 304 NOT MODIFIED
       $code != self::HTTP_NOT_MODIFIED;
   }
+
+  /**
+   *
+   */
+  public static function codeFromHeader($header)
+  {
+    $matches = array();
+    preg_match('/HTTP\/\S+\s(\d+)/', $header, $matches);
+    $n = $matches[1];
+    return $n;
+  }
 }
 ?>
\ No newline at end of file