/** * Singleton method for getting cache instance * * @param string $type Cache type supported 'File', 'Memcached' now * @return Hush_Cache */ public static function getInstance($type) { if (!self::$_cache) { self::$_cache = self::factory($type); } return self::$_cache; }
/** * Get static or cached acl object * * @return Ihush_Acl_Frontend */ public static function getInstance() { if (!self::$_acl) { $class_name = __CLASS__; require_once 'Ihush/Cache.php'; // we store cache in 60 seconds $cache = Ihush_Cache::factory('File', 60); if (!(self::$_acl = $cache->load($class_name))) { self::$_acl = new $class_name(); // init the acl object $cache->save(self::$_acl, $class_name); } } return self::$_acl; }