Mercurial > SimpleWebPresenter
comparison common-functions.inc @ 39:bd82b719a0de
Make CacheTimeCheck a singleton.
Robustify if_modified_since check.
Quiet warnings.
Set debug levels.
Fix basepath references.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Fri, 05 Oct 2012 00:21:27 +0200 |
| parents | ca76d31b7d48 |
| children | fbbb82ced6de |
comparison
equal
deleted
inserted
replaced
| 38:42533600214b | 39:bd82b719a0de |
|---|---|
| 1 <?php | 1 <?php |
| 2 include_once 'http-response-status-codes.inc'; | 2 include_once 'CacheTimeCheck.inc'; |
| 3 | |
| 4 $cache = CacheTimeCheck::instance(__FILE__); | |
| 5 $cache->includeOnce('http-response-status-codes.inc'); | |
| 6 | |
| 7 function basePath() | |
| 8 { | |
| 9 $l = strrpos($_SERVER['SCRIPT_FILENAME'], $_SERVER['SCRIPT_NAME']); | |
| 10 return substr($_SERVER['SCRIPT_FILENAME'], 0, $l); | |
| 11 } | |
| 3 | 12 |
| 4 function loadFile($sFilename, $sCharset = 'UTF-8') | 13 function loadFile($sFilename, $sCharset = 'UTF-8') |
| 5 { | 14 { |
| 6 if (floatval(phpversion()) >= 4.3) { | 15 if (floatval(phpversion()) >= 4.3) { |
| 7 if (!file_exists($sFilename)) | 16 if (!file_exists($sFilename)) |
