/** * Returns an instance of the global cache. * The cache type used is defined in options. * * @return vB_Cache - Reference to instance of the cache handler */ public static function instance() { if (!isset(self::$instance)) { // TODO: Use config to determine the cache types to use self::$instance = vB_Cache_Db::instance(); // TODO: Get appropriate class from options self::$instance->attachObserver(vB_Cache_Observer_Db::instance(self::$instance)); vB::$vbulletin->shutdown->add(array(self::$instance, 'shutdown')); } if (vB::$vbulletin->debug and $_REQUEST['nocache']) { vB::$vbulletin->options['nocache'] = 1; } return self::$instance; }