]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-cache.php
A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / extensions / ext-cache.php
index 91cbff076727e0c82b2718e13c62db0572984c61..487e7d66c7c50e68a0e6f11cd874fe475da2d1d8 100644 (file)
@@ -19,6 +19,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -61,15 +62,15 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('cache_stats','config_config')");
 
                // Unregister all filters
-               unregisterFilter('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, getExtensionDryRun());
-               unregisterFilter('extension_remove', 'CACHE_DESTROY_ALL', true, getExtensionDryRun());
-               unregisterFilter('shutdown', 'CACHE_DESTROY_FILTER', true, getExtensionDryRun());
+               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());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -200,14 +201,14 @@ switch (getExtensionMode()) {
 
                        case '0.2.1': // SQL queries for v0.2.1
                                // Register the new filter
-                               registerFilter('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, getExtensionDryRun());
-                               registerFilter('extension_remove', 'CACHE_DESTROY_ALL', false, true, getExtensionDryRun());
+                               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());
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Filter für Erweiterungsmanagement hinzugefügt.");
@@ -225,12 +226,12 @@ switch (getExtensionMode()) {
                                setExtensionUpdateNotes("Cachen von Filtern hinzugefügt.");
 
                                // Register a new filter
-                               registerFilter('shutdown', 'CACHE_DESTROY_FILTER', false, true, getExtensionDryRun());
+                               registerFilter('shutdown', 'CACHE_DESTROY_FILTER', false, true, isExtensionDryRun());
                                break;
 
                        case '0.2.4': // SQL queries for v0.2.4
                                // SQL commands to run
-                               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_cache')");
+                               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_cache' LIMIT 1");
 
                                // Remove config entries
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_themes`");
@@ -263,7 +264,7 @@ switch (getExtensionMode()) {
                break;
 
        default: // Unknown extension mode
-               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
                break;
 }