/** * Gets APC instance if exists, otherwise creates a new instance. * * @return APC cache instance. */ public static function getInstance() { if (self::$instance === NULL) { self::$instance = new self(); } return self::$instance; }
/** * singleton function to return * the instance of the class * * @return APCCache or NoCache */ public static function singleton() { if (!Cache::$enabled) { return NoCache::singleton(); } if (!self::$instance) { self::$instance = new APCCache(); } return self::$instance; }