# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1349997390 -7200 # Node ID 1d5166aba2c5d2a0598f13678bf53cfa583f7fef # Parent 947d53f95ccdae9a0d2fc51fa3f2184eee2d4bc4 Documentation fixes. codeFromHeader now throws an exception if the header is malformed. diff -r 947d53f95ccd -r 1d5166aba2c5 FileCacheSet.inc --- a/FileCacheSet.inc Fri Oct 12 01:06:32 2012 +0200 +++ b/FileCacheSet.inc Fri Oct 12 01:16:30 2012 +0200 @@ -37,7 +37,7 @@ /** * List a set of files which contributes to this pages cacheset. * - * @param $humanReadable If the timestamp should be humand readable. + * @param $humanReadable If the timestamp should be human readable. * * @return an associative array of file, and timestamp */ diff -r 947d53f95ccd -r 1d5166aba2c5 Sitemap.inc --- a/Sitemap.inc Fri Oct 12 01:06:32 2012 +0200 +++ b/Sitemap.inc Fri Oct 12 01:16:30 2012 +0200 @@ -8,11 +8,19 @@ $cache->includeOnce('Options.inc', dirname(__FILE__)); /// @endcond +/** + * Functionality for generating a sitemap + */ class Sitemap { private $master; private $options; + /** + * Constructs a sitemap object from a master document + * + * @param $path location of master document + */ function __construct($path) { $this->master = new DOMDocument(); $this->master->load($path); diff -r 947d53f95ccd -r 1d5166aba2c5 StatusCodes.inc --- a/StatusCodes.inc Fri Oct 12 01:06:32 2012 +0200 +++ b/StatusCodes.inc Fri Oct 12 01:16:30 2012 +0200 @@ -294,12 +294,16 @@ } /** + * Extract the numeric code from a header * + * @param $header an http top header */ public static function codeFromHeader($header) { $matches = array(); preg_match('/HTTP\/\S+\s(\d+)/', $header, $matches); + if ($matches->length < 1) + throw new Exception("Not an http header"); $n = $matches[1]; return $n; } diff -r 947d53f95ccd -r 1d5166aba2c5 sitemap.php --- a/sitemap.php Fri Oct 12 01:06:32 2012 +0200 +++ b/sitemap.php Fri Oct 12 01:16:30 2012 +0200 @@ -10,8 +10,8 @@ $baseDir = dirname(__FILE__); $cache = ScriptIncludeCache::instance(__FILE__); $cache->includeOnce('Sitemap.inc', dirname(__FILE__)); -/// @endcond $sitemap = new Sitemap("master.xml"); $sitemap->genPage(); +/// @endcond ?>