Mercurial > SimpleWebPresenter
comparison index.php @ 47:66382989353f
Extract baseDir only once.
Function for generating cacheset.
Added logger functionality.
Removed hardcoded location for flagScript.
BUGFIX: masterdocument was not added to the cacheset.
BUGFIX: When two options existed next to eachother, the last was not
read.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Mon, 08 Oct 2012 17:35:08 +0200 |
| parents | 79f708a48a7c |
| children | 2cfea6e84694 |
comparison
equal
deleted
inserted
replaced
| 46:15879e2aab65 | 47:66382989353f |
|---|---|
| 3 | 3 |
| 4 $cacheable = true; | 4 $cacheable = true; |
| 5 | 5 |
| 6 include_once 'CacheTimeCheck.inc'; | 6 include_once 'CacheTimeCheck.inc'; |
| 7 | 7 |
| 8 $baseDir = dirname(__FILE__); | |
| 9 | |
| 8 $cache = CacheTimeCheck::instance(__FILE__); | 10 $cache = CacheTimeCheck::instance(__FILE__); |
| 9 $cache->includeOnce('Options.inc', dirname(__FILE__)); | 11 $cache->includeOnce('Options.inc', $baseDir); |
| 10 $cache->includeOnce('accept-language.inc', dirname(__FILE__)); | 12 $cache->includeOnce('accept-language.inc', $baseDir); |
| 11 $cache->includeOnce('common-functions.inc', dirname(__FILE__)); | 13 $cache->includeOnce('common-functions.inc', $baseDir); |
| 12 $cache->includeOnce('filters.inc', dirname(__FILE__)); | 14 $cache->includeOnce('filters.inc', $baseDir); |
| 13 $cache->includeOnce('inputParser.inc', dirname(__FILE__)); | 15 $cache->includeOnce('inputParser.inc', $baseDir); |
| 16 $cache->includeOnce('logger.inc', $baseDir); | |
| 14 | 17 |
| 15 if (DEBUG_LEVEL >= VERBOSITY_DEBUG) { | 18 if (DEBUG_LEVEL >= VERBOSITY_DEBUG) { |
| 16 var_dump($_SERVER); | 19 var_dump($_SERVER); |
| 17 } | 20 } |
| 18 | 21 |
| 19 $master = new DOMDocument(); | 22 $master = new DOMDocument(); |
| 20 $masterName = basePath() . "/master.xml"; | 23 $masterName = basePath() . "/master.xml"; |
| 24 $cache->cache_time($masterName); | |
| 21 $master->load($masterName); | 25 $master->load($masterName); |
| 22 | 26 |
| 23 $options = new Options($master); | 27 $options = new Options($master); |
| 24 $options->setCache($cache); | 28 $options->setCache($cache); |
| 25 $options->setBasePath(basePath()); | 29 $options->setBasePath(basePath()); |
| 54 | 58 |
| 55 if (CACHING && $cacheable) | 59 if (CACHING && $cacheable) |
| 56 $options->getCache()->CheckHttpModified(); | 60 $options->getCache()->CheckHttpModified(); |
| 57 | 61 |
| 58 print $master->saveXml($master); | 62 print $master->saveXml($master); |
| 63 //print_r($cache->cacheSet(1)); | |
| 59 | 64 |
| 60 ?> | 65 ?> |
