Many rewrites to get rid of dublicate modreg inserts while ext-cache is registered
[mailer.git] / inc / extensions / ext-cache.php
index 75780f06d20cf0e4ddca1a8a87e2deb99b4c501e..171752500a96abdbb5e9bc58ea2517986413c86d 100644 (file)
@@ -49,8 +49,8 @@ EXT_SET_VERSION('0.2.2');
 // Version history array (add more with , '0.1.0' and so on)
 EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2'));
 
-switch ($EXT_LOAD_MODE)
-{
+// Which load mode?
+switch ($EXT_LOAD_MODE) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // SQL commands to run
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_update BIGINT(20) UNSIGNED NOT NULL DEFAULT 3600");
@@ -87,8 +87,8 @@ switch ($EXT_LOAD_MODE)
                break;
 
        case 'update': // Update an extension
-               switch ($EXT_VER)
-               {
+               // Which version?
+               switch ($EXT_VER) {
                        case '0.0.1': // SQL queries for v0.0.1
                                // Update notes (these will be set as task text!)
                                EXT_SET_UPDATE_NOTES("Es wurde die Zeitmarke der Cache-Datei extensions.cache mit berücksichtigt. Dies hatte die Folge, dass wenn bei einem Gast die Datei aktualisiert wurde, nur aktivierte und nicht die deaktivierten mit geladen wurden. Folglich fiehlen einfach ein paar Erweiterungen aus.");
@@ -240,23 +240,23 @@ switch ($EXT_LOAD_MODE)
                }
                break;
 
-                       case 'modify': // When the extension got modified
-                               break;
+       case 'modify': // When the extension got modified
+               break;
 
-                       case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
-                               break;
+       case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+               break;
 
-                       default: // Do stuff when extension is loaded
-                               // Create instance on class
-                               if ($GLOBALS['cache_mode'] != 'init') {
-                                       // Initialize cache system only when it's needed
-                                       $GLOBALS['cache_instance'] = new CacheSystem(getConfig('cache_update'), "inc/".getConfig('cache_path'), getConfig('cache_tested'));
-                                       if ($GLOBALS['cache_instance']->getStatus() != 'done') {
-                                               // Failed to initialize cache sustem
-                                               addFatalMessage(__FILE__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_CANNOT_INITIALIZE'));
-                                       } // END - if
-                               } // END - if
-                               break;
+       default: // Do stuff when extension is loaded
+               // Create instance on class
+               if ($GLOBALS['cache_mode'] != 'init') {
+                       // Initialize cache system only when it's needed
+                       $GLOBALS['cache_instance'] = new CacheSystem(getConfig('cache_update'), 'inc/' . getConfig('cache_path'), getConfig('cache_tested'));
+                       if ($GLOBALS['cache_instance']->getStatus() != 'done') {
+                               // Failed to initialize cache sustem
+                               addFatalMessage(__FILE__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_CANNOT_INITIALIZE'));
+                       } // END - if
+               } // END - if
+               break;
 }
 
 // Keep this extension always active!