Mercurial > SimpleWebPresenter
changeset 72:7bc88fe62101
Branch merge.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 11 Oct 2012 23:47:12 +0200 |
| parents | 218a58bb2f34 (current diff) 62b9d7a35658 (diff) |
| children | 947d53f95ccd |
| files | |
| diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/FileCacheSet.inc Thu Oct 11 23:46:32 2012 +0200 +++ b/FileCacheSet.inc Thu Oct 11 23:47:12 2012 +0200 @@ -5,17 +5,30 @@ $cache = ScriptIncludeCache::instance(__FILE__); $cache->cache_time("${baseDir}/Logger.inc"); +/** + * Caches a set of file with timestamps + */ class FileCacheSet { private $newest = 0; private $files = array(); private $parentCaches = array(); + /** + * Constructs a FileCacheSet object + * + * @param $parent optional linked parent cache to sync with + */ protected function __construct($parent = null) { if ($parent) { $this->addParent($parent); } } + /** + * Links up a parent cache + * + * @param $parent cache we should sync with + */ protected function addParent($parent) { array_push($this->parentCaches, $parent); @@ -63,6 +76,11 @@ } } + /** + * Find the newest member of the combined cacheset + * + * @return timestamp of newest member + */ function getNewest() { $newest = 0; @@ -74,6 +92,11 @@ } } +/** + * Singleton class, keeps track of all scriptfile includes + * + * This class is typically used as a parent class of another cache + */ class ScriptIncludeCache extends FileCacheSet { private static $myInstance = 0;
