]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-cache.php
Updated domain without a dash :(
[mailer.git] / inc / extensions / ext-cache.php
index ee324dcf1c81c2b85ba52ae715c474f8e4c831b7..f024ebdb05ab89aeb993afb1e44cf671a1968fa4 100644 (file)
@@ -6,7 +6,7 @@
  * -------------------------------------------------------------------- *
  * File              : ext-cache.php                                    *
  * -------------------------------------------------------------------- *
- * Short description : Caching system for SQL tables on hard disc       *
+ * Short description : Caching system for SQL tables on hard drive      *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Caching-System zum Auslagern von SQL-Tabellen    *
  *                     auf der Festplatte des Servers                   *
@@ -17,8 +17,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -52,7 +52,7 @@ setExtensionAlwaysActive('Y');
 
 // Which load mode?
 switch (getExtensionMode()) {
-       case 'register': // Do stuff when installation is running
+       case 'setup': // Do stuff when installation is running
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -60,15 +60,15 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('cache_stats','config_config')");
 
                // Unregister all filters
-               unregisterFilter(__FUNCTION__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -100,14 +100,8 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.0.4': // SQL queries for v0.0.4
-                               // Is the cache extension itself there?
-                               if (isExtensionActive('cache')) {
-                                       // Check for cache when extension is already installed
-                                       if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
-                               } // END - if
-
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Spalte "keep_active" ist hinzugefügt. Cache wurde reinitialisiert.");
+                               setExtensionUpdateNotes("Spalte "keep_active" ist hinzugefügt.");
                                break;
 
                        case '0.0.5': // SQL queries for v0.0.5
@@ -190,23 +184,20 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.2.0': // SQL queries for v0.2.0
-                               // This update depends on sql_patches
-                               addExtensionDependency('sql_patches');
-
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Die Erweiterung h&auml;ngt nun von der <strong>sql_patches</strong> ab.");
                                break;
 
                        case '0.2.1': // SQL queries for v0.2.1
                                // Register the new filter
-                               registerFilter('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
-                               registerFilter('extension_remove', 'CACHE_DESTROY_ALL', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', FALSE, TRUE, isExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Filter f&uuml;r Erweiterungsmanagement hinzugef&uuml;gt.");
@@ -224,7 +215,7 @@ switch (getExtensionMode()) {
                                setExtensionUpdateNotes("Cachen von Filtern hinzugef&uuml;gt.");
 
                                // Register a new filter
-                               registerFilter('shutdown', 'CACHE_DESTROY_FILTER', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', FALSE, TRUE, isExtensionDryRun());
                                break;
 
                        case '0.2.4': // SQL queries for v0.2.4
@@ -249,7 +240,7 @@ switch (getExtensionMode()) {
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Daten von gefundenen Sprachdateien werden zu den Erweiterungen gecacht.");
                                break;
-               }
+               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
@@ -262,9 +253,9 @@ switch (getExtensionMode()) {
                break;
 
        default: // Unknown extension mode
-               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+               reportBug(__FILE__, __LINE__, sprintf('Unknown extension mode %s in extension %s detected.', getExtensionMode(), getCurrentExtensionName()));
                break;
-}
+} // END - switch
 
 // [EOF]
 ?>