/** * Instantiate a cache. */ function MemcacheCache($context, $cacheId, $fallback, $hostname, $port) { parent::GenericCache($context, $cacheId, $fallback); $this->connection = new Memcache(); if (!$this->connection->connect($hostname, $port)) { $this->connection = null; } $this->flag = null; $this->expire = 3600; // 1 hour default expiry }
/** * Instantiate a cache. */ function FileCache($context, $cacheId, $fallback, $path) { parent::GenericCache($context, $cacheId, $fallback); $this->filename = $path . DIRECTORY_SEPARATOR . "fc-{$context}-" . str_replace('/', '.', $cacheId) . '.php'; // Load the cache data if it exists. if (file_exists($this->filename)) { $this->cache = (include $this->filename); } else { $this->cache = null; } }
/** * Instantiate a cache. */ function FileCache($context, $cacheId, $fallback, $path) { parent::GenericCache($context, $cacheId, $fallback); $this->filename = $path . DIRECTORY_SEPARATOR . "fc-{$context}-" . str_replace('/', '.', $cacheId) . '.php'; // Load the cache data if it exists. if (($fp = @fopen($this->filename, 'r')) !== false) { flock($fp, LOCK_SH); $this->cache = (include $this->filename); flock($fp, LOCK_UN); } else { $this->cache = null; } }
/** * Instantiate a cache. */ function FileCache($context, $cacheId, $fallback, $path) { parent::GenericCache($context, $cacheId, $fallback); $this->filename = $path . DIRECTORY_SEPARATOR . "fc-{$context}-" . str_replace('/', '.', $cacheId) . '.php'; // Load the cache data if it exists. (To avoid a race condition, // we assume the file exists and suppress the potential warn.) $result = @(include $this->filename); if ($result !== false) { $this->cache = $result; } else { $this->cache = null; } }
/** * Constructor */ function GenericOrderedCache($objtype, $load_all, $tablename, $prefix = '', $dbIDname = 'ID', $name_field = NULL) { parent::GenericCache($objtype, $load_all, $tablename, $prefix, $dbIDname, $name_field); }
/** * Instantiate a cache. */ function XCacheCache($context, $cacheId, $fallback) { parent::GenericCache($context, $cacheId, $fallback); }
/** * Constructor */ function GenericCategoryCache($objtype, $load_all, $tablename, $prefix = '', $dbIDname = 'ID', $name_field = NULL, $subset_property = NULL) { parent::GenericCache($objtype, $load_all, $tablename, $prefix, $dbIDname, $name_field); $this->subset_property = $subset_property; }
/** * Constructor */ function GenericCategoryCache($objtype, $load_all, $tablename, $prefix = '', $dbIDname = 'ID', $name_field = NULL, $subset_property = NULL, $order_by = '', $allow_none_text = NULL, $allow_none_value = '', $select = '') { parent::GenericCache($objtype, $load_all, $tablename, $prefix, $dbIDname, $name_field, $order_by, $allow_none_text, $allow_none_value, $select); $this->subset_property = $subset_property; }