public static function initCache() { global $app_i; switch ($app_i['cache']) { case CC_NOCACHE: return null; case CC_APC: if (!isset(self::$_apc)) { self::$_apc = new CApcCache(); return self::$_apc; } return self::$_apc; case CC_MEMCACHE: if (!isset(self::$_memcache)) { self::$_memcache = new CMemCache(); return self::$_memcache; } return self::$_memcache; } return null; }