/** * singleton function to return * the instance of the class * * @return Memcache or NoCache */ public static function singleton() { if (!Cache::$enabled) { return NoCache::singleton(); } if (!self::$instance) { self::$instance = new DiskCache(); } return self::$instance; }