]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
also prevent it in .htacces. You may want to add this to one of your files in /etc...
[mailer.git] / inc / extensions-functions.php
index 8dfde689bd230f9bc3be134c47b29850ef740518..f4aac2d35b6f77a1463a6a24d1a4f459d6b2f669 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Erweiterungen-Management                         *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -249,7 +244,7 @@ function registerExtension ($ext_name, $taskId, $isDryRun = FALSE, $ignoreUpdate
        initIncludePool('extension');
 
        // By default there is no failure
-       enableExtensionReportingFailure();
+       enableExtensionReportingFailure(FALSE);
 
        // Does this extension exists?
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ' - CALLING loadExtension() ...');
@@ -873,7 +868,7 @@ function addExtensionVerboseSqlTable ($title = '{--ADMIN_SQLS_EXECUTED_ON_REMOVA
                        $OUT = loadTemplate('admin_extension_sql_table', TRUE, $content);
                } else {
                        // No addional SQL commands to run
-                       $OUT = displayMessage('{--ADMIN_EXTENSION_VERBOSE_SQLS_404--}', TRUE);
+                       $OUT = returnMessage('{--ADMIN_EXTENSION_VERBOSE_SQLS_404--}');
                }
        } // END - if
 
@@ -957,7 +952,7 @@ function isExtensionNameValid ($ext_name) {
        // Is there cache?
        if (!isset($GLOBALS['ext_name_valid'][$ext_name])) {
                // Generate include file name
-               $INC = sprintf("inc/extensions/ext-%s.php", $ext_name);
+               $INC = sprintf('inc/extensions/ext-%s.php', $ext_name);
 
                // Is there a file in inc/extensions/ ?
                $GLOBALS['ext_name_valid'][$ext_name] = isIncludeReadable($INC);
@@ -1053,7 +1048,7 @@ function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
                } // END - if
        } else {
                // Extension not there! :-(
-               reportBug(__FUNCTION__, __LINE__, sprintf("Extension <span class=\"data\">%s</span> not found but should be updated?", $ext_name));
+               reportBug(__FUNCTION__, __LINE__, sprintf('Extension <span class="data">%s</span> not found but should be updated?', $ext_name));
        }
 
        // Return task id
@@ -1063,7 +1058,7 @@ function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
 // Creates a new task for newly installed extension
 function createNewExtensionTask ($ext_name) {
        // Generate subject line
-       $subject = sprintf("[%s:]", $ext_name);
+       $subject = sprintf('[%s:]', $ext_name);
 
        // Get task id
        $taskId = determineTaskIdBySubject($subject);
@@ -1100,7 +1095,7 @@ function createNewExtensionTask ($ext_name) {
 // Creates a task for automatically deactivated (deprecated) extension
 function createExtensionDeactivationTask ($ext_name) {
        // Create subject line
-       $subject = sprintf("[%s:] %s", $ext_name, '{--ADMIN_TASK_EXTENSION_DEACTIVATED_SUBJECT--}');
+       $subject = sprintf('[%s:] %s', $ext_name, '{--ADMIN_TASK_EXTENSION_DEACTIVATED_SUBJECT--}');
 
        // Get task id
        $taskId = determineTaskIdBySubject($subject);
@@ -1487,8 +1482,8 @@ function incrementExtensionUpdateIterator () {
        $GLOBALS['ext_depend_iterator'][getCurrentExtensionName()]++;
 }
 
-// Setter for EXT_REPORTS_FAILURE flag
-function enableExtensionReportingFailure ($reportsFailure = FALSE) {
+// Setter for EXT_REPORTS_FAILURE flag (default: extension reported installation failure)
+function enableExtensionReportingFailure ($reportsFailure = TRUE) {
        $GLOBALS['ext_reports_failure'] = (bool) $reportsFailure;
 }
 
@@ -1618,7 +1613,7 @@ function getExtensionSqls () {
        // Output debug backtrace if not found (SHOULD NOT HAPPEN!)
        if (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()])) {
                // Not found, should not happen
-               reportBug(__FUNCTION__, __LINE__, sprintf("ext_sqls is empty, current extension: %s",
+               reportBug(__FUNCTION__, __LINE__, sprintf('ext_sqls is empty, current extension: %s',
                        getCurrentExtensionName()
                ));
        } // END - if
@@ -1632,7 +1627,7 @@ function countExtensionSqls () {
        // Output debug backtrace if not found (SHOULD NOT HAPPEN!)
        if (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()])) {
                // Not found, should not happen
-               reportBug(__FUNCTION__, __LINE__, sprintf("ext_sqls is empty, current extension: %s",
+               reportBug(__FUNCTION__, __LINE__, sprintf('ext_sqls is empty, current extension: %s',
                        getCurrentExtensionName()
                ));
        } // END - if
@@ -1822,7 +1817,7 @@ function loadCurrentExtensionInclude () {
        } // END - if
 
        // Generate INC name
-       $INC = sprintf("inc/extensions/ext-%s.php", getCurrentExtensionName());
+       $INC = sprintf('inc/extensions/ext-%s.php', getCurrentExtensionName());
 
        // Load it
        loadInclude($INC);
@@ -1831,7 +1826,7 @@ function loadCurrentExtensionInclude () {
 // Load current extension's mode include file
 function loadCurrentExtensionModeInclude () {
        // Generate INC name
-       $INC = sprintf("inc/extensions/%s/mode-%s.php", getCurrentExtensionName(), getExtensionMode());
+       $INC = sprintf('inc/extensions/%s/mode-%s.php', getCurrentExtensionName(), getExtensionMode());
 
        // Is the include readable?
        if (isIncludeReadable($INC)) {
@@ -1850,7 +1845,7 @@ function isExtensionIncludeReadable ($ext_name = '') {
        // Array found?
        if (!isset($GLOBALS['ext_inc_readable'][$ext_name])) {
                // Generate INC name
-               $INC = sprintf("inc/extensions/ext-%s.php", getCurrentExtensionName());
+               $INC = sprintf('inc/extensions/ext-%s.php', getCurrentExtensionName());
 
                // Is it readable?
                $GLOBALS['ext_inc_readable'][$ext_name] = isIncludeReadable($INC);
@@ -1871,7 +1866,7 @@ function isExtensionFunctionFileReadable ($ext_name) {
                incrementStatsEntry('cache_hits');
        } else {
                // Construct IFN for functions file
-               $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
+               $funcsInclude = sprintf('inc/libs/%s_functions.php', $ext_name);
 
                // Is this include there?
                $isIncludeFound = ((isFileReadable($funcsInclude)) && (!isExtensionLibraryLoaded($ext_name)) && (getExtensionMode() == 'test'));
@@ -1961,7 +1956,7 @@ function addAdminMenuSql ($action, $what, $title, $descr, $sort) {
                addExtensionSql($sql);
        } elseif (isDebugModeEnabled()) {
                // Double menus should be located and fixed!
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double admin menu action=%s,what=%s,title=%s detected.", $action, $what, $title));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Double admin menu action=%s,what=%s,title=%s detected.', $action, $what, $title));
        }
 }
 
@@ -1991,7 +1986,7 @@ function addGuestMenuSql ($action, $what, $title, $sort) {
                addExtensionSql($sql);
        } elseif (isDebugModeEnabled()) {
                // Double menus should be located and fixed!
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double guest menu action=%s,what=%s,title=%s detected.", $action, $what, $title));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Double guest menu action=%s,what=%s,title=%s detected.', $action, $what, $title));
        }
 }
 
@@ -2021,7 +2016,7 @@ function addMemberMenuSql ($action, $what, $title, $sort) {
                addExtensionSql($sql);
        } elseif (isDebugModeEnabled()) {
                // Double menus should be located and fixed!
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double member menu action=%s,what=%s,title=%s detected.", $action, $what, $title));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Double member menu action=%s,what=%s,title=%s detected.', $action, $what, $title));
        }
 }
 
@@ -2053,7 +2048,7 @@ function addSponsorMenuSql ($action, $what, $title, $active, $sort) {
                addExtensionSql($sql);
        } elseif (isDebugModeEnabled()) {
                // Double menus should be located and fixed!
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double sponsor menu action=%s,what=%s,title=%s,active=%s detected.", $action, $what, $title, $active));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Double sponsor menu action=%s,what=%s,title=%s,active=%s detected.', $action, $what, $title, $active));
        }
 }
 
@@ -2140,7 +2135,7 @@ function addExtensionChangeTableColumnSql ($tableName, $fromColumnName, $toColum
        assert(($fromColumnName != $columnSql) && ($toColumnName != $columnSql));
 
        // Is the column there?
-       if ((ifSqlTableColumnExists('{?_MYSQL_PREFIX?}_' . $tableName, $fromColumnName)) && (($fromColumnName == $toColumnName) || (!ifSqlTableColumnExists('{?_MYSQL_PREFIX?}_' . $tableName, $toColumnName, isInstaller())))) {
+       if ((ifSqlTableColumnExists('{?_MYSQL_PREFIX?}_' . $tableName, $fromColumnName, isInstaller())) && (($fromColumnName == $toColumnName) || (!ifSqlTableColumnExists('{?_MYSQL_PREFIX?}_' . $tableName, $toColumnName, isInstaller())))) {
                // Debug message
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',fromColumnName=' . $fromColumnName . ',toColumnName=' . $toColumnName . ',columnSql=' . $columnSql);