]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load-modules.php
Large code cleanups:
[mailer.git] / inc / loader / load-modules.php
index e9ae70acdf3ace224dd5933fc0ccb84ddf9efbf4..84e1dc4fddf95d9422c141a884c9cd2523166513 100644 (file)
@@ -53,8 +53,11 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i
 
        // Do only process valid arrays
        if (!isset($modArray['module'])) {
-               // We should fix this!
-               debug_report_bug(__FILE__, __LINE__, 'modArray=<pre>'.print_r($modArray, true).'</pre>');
+               // Try to remove the cache file
+               $GLOBALS['cache_instance']->removeCacheFile();
+
+               // We should fix this
+               debug_report_bug(__FILE__, __LINE__, 'modArray=<pre>' . print_r($modArray, true) . '</pre>Please try to reload to fix this.');
        } // END - if
 
        // Rewrite some parts
@@ -88,26 +91,41 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i
        // Create cache file here
        $GLOBALS['cache_instance']->init();
 
-       // Load all modules and their data
+       // Do we have up-to-date ext-sql_patches?
        if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
-               // Load has_menu
+               // Yes, has_menu shall be there
                $result = SQL_QUERY('SELECT
-       `id`,`module`,`title`,`locked`,`hidden`,`admin_only`,`title`,`mem_only`,`has_menu`
+       `id`,
+       `module`,
+       `title`,
+       `locked`,
+       `hidden`,
+       `admin_only`,
+       `title`,
+       `mem_only`,
+       `has_menu`
 FROM
        `{?_MYSQL_PREFIX?}_mod_reg`
 ORDER BY
        `module` ASC', __FILE__, __LINE__);
        } else {
-               // Don't load has_menu
+               // Not recent enough ext-sql_patches ...
                $result = SQL_QUERY('SELECT
-       `id`,`module`,`title`,`locked`,`hidden`,`admin_only`,`title`,`mem_only`
+       `id`,
+       `module`,
+       `title`,
+       `locked`,
+       `hidden`,
+       `admin_only`,
+       `title`,
+       `mem_only`
 FROM
        `{?_MYSQL_PREFIX?}_mod_reg`
 ORDER BY
        `module` ASC', __FILE__, __LINE__);
        }
 
-       // Cache all data
+       // ... and load all entries
        while ($content = SQL_FETCHARRAY($result)) {
                // Add row to cache file
                $GLOBALS['cache_instance']->addRow($content);