# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1349992032 -7200 # Node ID 7bc88fe62101119e9c0dcb74bda2c133e5973227 # Parent 218a58bb2f347ec3090a69e6e482c691b31e54ec# Parent 62b9d7a35658a272271cb825b11aa6df60392881 Branch merge. diff -r 218a58bb2f34 -r 7bc88fe62101 FileCacheSet.inc --- 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;