]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
One more wrapper function introduced, fixed for installation phase
[mailer.git] / inc / extensions-functions.php
index ee5ff4908fc385e56f38c08793343a316683917c..c4e88abaf0e2c30d28e159c23a72515348249f42 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Load the extension and maybe found language and function files.
-function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run = false) {
+function loadExtension ($ext_name, $ext_mode, $ext_ver = '', $dry_run = false) {
        // If this happens twice, we need the bug report from you, except for updates/tests
        if ((isset($GLOBALS['loaded_extension'][$ext_name][$ext_mode])) && (!in_array($ext_mode, array('update', 'test')))) {
                debug_report_bug(__FUNCTION__, __LINE__, '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), true) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], true) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], true));
@@ -481,7 +481,7 @@ function isExtensionInstalled ($ext_name) {
        // We don't like empty extension names here
        if (empty($ext_name)) {
                // Please fix them all
-               debug_report_bug(__FUNCTION__.': ext_name is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty.');
        } // END - if
 
        // By default non is installed
@@ -522,8 +522,16 @@ function isExtensionInstalled ($ext_name) {
 
 // Check if given extension is active
 function isExtensionActive ($ext_name) {
-       // Extensions are all inactive during installation
-       if ((isInstallationPhase()) || (empty($ext_name))) return false;
+       if (isInstallationPhase()) {
+               // Extensions are all inactive during installation
+               return false;
+       } elseif (empty($ext_name)) {
+               // Empty extension names must befixed
+               debug_report_bug(__FUNCTION__, __LINE__, 'Empty extension name provided.');
+       } elseif (!isExtensionInstalled($ext_name)) {
+               // Not installed extensions are always inactive
+               return false;
+       }
 
        // Not active is the default
        $data['ext_active'] = 'N';
@@ -733,7 +741,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
        $OUT = '';
 
        // Do we have queries?
-       if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
+       if (isVerboseSqlEnabled()) {
                // Do we have entries?
                if (countExtensionSqls() > 0) {
                        // Init counter
@@ -1068,7 +1076,7 @@ function addExtensionNotes ($ext_ver) {
        $content = array();
 
        // Is do we have verbose output enabled?
-       if ((!isExtensionActive('sql_patches')) || (getConfig('verbose_sql') == 'Y')) {
+       if ((!isExtensionActive('sql_patches')) || (isVerboseSqlEnabled())) {
                // Update notes found?
                if (isExtensionUpdateNoteSet($ext_ver)) {
                        // Update notes found