X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-cache.php;h=25b0cb1434d0b86ebfd0f6a2bf3ee366d9330f3d;hp=6d32d311e041dabfe6260b3f61ae4dba6e1feb3f;hb=73e9d78e610057f6c6d311328b3ad438ad017791;hpb=2acfc49984a0f9bb3adaf6366351d6ce604dcacd diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 6d32d311e0..25b0cb1434 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -15,11 +15,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -62,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('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 @@ -123,8 +121,8 @@ switch (getExtensionMode()) { break; case '0.0.7': // SQL queries for v0.0.7 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD db_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD cache_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addConfigAddSql('db_hits', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); + addConfigAddSql('cache_hits', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); addAdminMenuSql('stats','cache_stats','DB-Cache','Auf Cache und gesamte Datenbank registrierte Anfragen anzeigen.', 4); // Update notes (these will be set as task text!) @@ -193,7 +191,7 @@ switch (getExtensionMode()) { case '0.2.0': // SQL queries for v0.2.0 // This update depends on sql_patches - addExtensionUpdateDependency('sql_patches'); + addExtensionDependency('sql_patches'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Die Erweiterung hängt nun von der sql_patches ab."); @@ -201,14 +199,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."); @@ -220,13 +218,13 @@ switch (getExtensionMode()) { break; case '0.2.3': // SQL queries for v0.2.3 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD cache_filter ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + addConfigAddSql('cache_filter', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Update notes (these will be set as task text!) 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 @@ -234,14 +232,14 @@ switch (getExtensionMode()) { 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`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_admins`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_acls`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_exts`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_config`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_modreg`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_refdepth`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_refsys`"); + addConfigDropSql('cache_themes'); + addConfigDropSql('cache_admins'); + addConfigDropSql('cache_acls'); + addConfigDropSql('cache_exts'); + addConfigDropSql('cache_config'); + addConfigDropSql('cache_modreg'); + addConfigDropSql('cache_refdepth'); + addConfigDropSql('cache_refsys'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Cache hat keine Konfiguration mehr."); @@ -257,7 +255,7 @@ switch (getExtensionMode()) { 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. + case 'test': // For testing purposes break; case 'init': // Do stuff when extension is initialized