# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1349654464 -7200 # Node ID 79f708a48a7c8421a8d2d1f9b283f5f02d7119ac # Parent f42dbf44b6616222df6fa022a8c6d790f2b7034c Added a constants include. Refactored out functions from sitemap. diff -r f42dbf44b661 -r 79f708a48a7c constants.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/constants.inc Mon Oct 08 02:01:04 2012 +0200 @@ -0,0 +1,17 @@ += VERBOSITY_WARNING) { + error_reporting(E_ALL); + ini_set("display_errors", 1); +} +?> \ No newline at end of file diff -r f42dbf44b661 -r 79f708a48a7c index.php --- a/index.php Fri Oct 05 03:16:23 2012 +0200 +++ b/index.php Mon Oct 08 02:01:04 2012 +0200 @@ -1,24 +1,5 @@ = VERBOSITY_DEBUG) { - var_dump($_SERVER); -} - -if (DEBUG_LEVEL >= VERBOSITY_WARNING) { - error_reporting(E_ALL); - ini_set("display_errors", 1); -} +include_once 'constants.inc'; $cacheable = true; @@ -31,6 +12,10 @@ $cache->includeOnce('filters.inc', dirname(__FILE__)); $cache->includeOnce('inputParser.inc', dirname(__FILE__)); +if (DEBUG_LEVEL >= VERBOSITY_DEBUG) { + var_dump($_SERVER); +} + $master = new DOMDocument(); $masterName = basePath() . "/master.xml"; $master->load($masterName); diff -r f42dbf44b661 -r 79f708a48a7c sitemap.php --- a/sitemap.php Fri Oct 05 03:16:23 2012 +0200 +++ b/sitemap.php Mon Oct 08 02:01:04 2012 +0200 @@ -9,48 +9,10 @@ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> 1), $info); - $headers = array(); - $str = explode("\n", $response); - foreach($str as $kv) { - $p = strpos($kv, ":"); - if ($p) { - $key = substr($kv, 0, $p); - $value = trim(substr($kv, $p + 1)); - $headers[$key] = $value; - } - } - return $headers; -} - -function opttostring($opts) -{ - $str = ''; - foreach (array_keys($opts) as $key) { - $value = $opts[$key]; - if ($str) { - $str .= "&${key}=${value}"; - } - else { - $str = "?${key}=${value}"; - } - } - return $str; -} - +$cache = CacheTimeCheck::instance(__FILE__); +$cache->includeOnce('Options.inc', dirname(__FILE__)); $master = new DOMDocument(); $master->load("master.xml");