- include_once(PATH."inc/libs/cache_functions.php");
- $cacheMode = "";
- include_once(PATH."inc/extensions/ext-cache.php");
- switch($cacheInstance->cache_file("extensions", true))
- {
- case true : $cacheMode = "load"; break;
- case false: $cacheMode = "init"; break;
+ if (!LOAD_EXTENSION('cache')) {
+ // Extension 'cache' was not loaded
+ trigger_error('Cannot load extension cache.');
+ } // END - if
+
+ // Check extension cache
+ switch (($GLOBALS['cache_instance']->loadCacheFile('extensions', true)) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
+ case true : $GLOBALS['cache_mode'] = 'load'; break;
+ case false: $GLOBALS['cache_mode'] = 'init'; break;
+ } // END - switch
+
+ // Do we need to init the cache? But not in "CSS mode".
+ if (($GLOBALS['cache_mode'] == 'init') && (getConfig('cache_exts') == 'Y') && (getOutputMode() == '0')) {
+ // Init cache file
+ $GLOBALS['cache_instance']->init('EXTENSIONS');
+ $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
+ } elseif (getConfig('cache_exts') != 'Y') {
+ // Cache will not be created for extensions
+ $GLOBALS['cache_mode'] = 'skip';