X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-rewrite.php;h=2f533fdd0aeca458b67e5e9cc2b7e053a179c3b4;hp=07a4714624f3b42b3395444e6db56abf6a1b1c60;hb=6d08952d672c5a5de7d8522f894a5665599a2a4a;hpb=09f5758c42a33a56bdd461c946ffe759a59c54aa diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 07a4714624..2f533fdd0a 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -14,12 +14,10 @@ * $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 * - * 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 * @@ -40,23 +38,23 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Version number setThisExtensionVersion('0.1.3'); -// Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(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')); +// Version history array (add more with , '0.0.1' and so on) +setExtensionVersionHistory(array('0.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')); -// This extension is deprecated! -// Only since 'seo' is ready! setExtensionDeprecated('Y'); +// This extension is deprecated +// @TODO Only when 'seo' is ready: setExtensionDeprecated('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'setup': // Do stuff when installation is running // Check if mod_rewrite is loadeded if (!isApacheModuleLoaded('mod_rewrite')) { - setExtensionReportsFailure(true); - addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); + enableExtensionReportingFailure(); + addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}'); } // END - if // SQL commands to run @@ -71,9 +69,9 @@ switch (getExtensionMode()) { case 'activate': // Do stuff when admin activates this extension // Check if mod_rewrite is loadeded if (!isApacheModuleLoaded('mod_rewrite')) { - SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__); - setExtensionReportsFailure(true); - addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); + sqlQuery("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__); + enableExtensionReportingFailure(); + addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}'); } // END - if // SQL commands to run @@ -126,7 +124,7 @@ switch (getExtensionMode()) { break; case '0.0.9': // SQL queries for v0.0.9 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'"); + addConfigAddSql('rewrite_skip', "VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'"); addAdminMenuSql('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module übersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8); // Update notes (these will be set as task text!) @@ -150,8 +148,8 @@ switch (getExtensionMode()) { case '0.1.3': // Check if mod_rewrite is loadeded if (!isApacheModuleLoaded('mod_rewrite')) { - setExtensionReportsFailure(true); - //addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); + enableExtensionReportingFailure(); + //addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}'); } // END - if setExtensionUpdateNotes("Es wird beim Registrieren und aktivieren geprüft, ob im Apache das Modul mod_rewrite geladen wurde. Wenn mod_rewrite nicht gefunden werden konnte, wird abgebrochen."); break; @@ -161,20 +159,22 @@ 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 // Check if mod_rewrite is loadeded if (!isApacheModuleLoaded('mod_rewrite')) { - setExtensionReportsFailure(true); - SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__); - if (!isAdmin()) addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); + enableExtensionReportingFailure(); + sqlQuery("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__); + if (!isAdmin()) { + addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}'); + } // END - if } // END - if break; default: // Unknown extension mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode())); + reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; }