/** * Singleton * @return Application_Model_CacheMapper */ public static function i() { if (self::$_instance == null) { self::$_instance = new self(); } return self::$_instance; }
/** * Retrieve a forced item even if plugin is disabled * Forced items are stored under the manual:forced: namespace * * @param string $key * @return string * @throws Exception if no valid item with $key found */ public static function forcedRetrieveItem($key) { $key = "manual:forced:{$key}"; $cacheEntry = new Application_Model_Cache(); Application_Model_CacheMapper::i()->fetchByUri($key, $cacheEntry); if (!$cacheEntry->isValid(time())) { throw new Exception("Invalid cache key"); } return $cacheEntry->getContent(); }