Mercurial > SimpleWebPresenter
diff CacheTimeCheck.inc @ 40:fbbb82ced6de
Fixes for CacheTimeCheck->includeOnce paths.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Fri, 05 Oct 2012 00:41:30 +0200 |
| parents | bd82b719a0de |
| children | 66382989353f |
line wrap: on
line diff
--- a/CacheTimeCheck.inc Fri Oct 05 00:21:27 2012 +0200 +++ b/CacheTimeCheck.inc Fri Oct 05 00:41:30 2012 +0200 @@ -27,7 +27,7 @@ var_dump($_SERVER); $gmdate_mod = gmdate('D, d M Y H:i:s', $this->newest) . ' GMT'; - + if(array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) { $HTTP_IF_MODIFIED_SINCE = $_SERVER['HTTP_IF_MODIFIED_SINCE']; $if_modified_since = preg_replace('/;.*$/', '', $HTTP_IF_MODIFIED_SINCE); @@ -41,11 +41,12 @@ header("Last-Modified: $gmdate_mod"); } - function cache_time($path) + function cache_time($path, $basedir = False) { if (!file_exists($path)) { - if (DEBUG) + if (DEBUG_LEVEL >= VERBOSITY_WARNING) print "${path} does not exist"; + var_dump($_SERVER); errorPage("Resource not available"); } @@ -56,8 +57,10 @@ } } - function includeOnce($path) + function includeOnce($path, $basedir = false) { + if ($basedir) + $path = $basedir . "/" . $path; $this->cache_time($path); include_once($path); }
