]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load_cache-modules.php
Fix for missing variable, thanks to wernisman
[mailer.git] / inc / loader / load_cache-modules.php
index 8c66caa8a5e6066a53fb15698a227a681c02130a..e957bc63be0d835b5842cced44972bdb131a1a2d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 09/09/2008 *
- * ===============                              Last change: 09/09/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 09/09/2008 *
+ * ===================                          Last change: 09/09/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : load_cache-modules.php                           *
@@ -41,6 +41,9 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
+// Use this code if you don't want to run this cache loader on installation phase
+if (isInstallationPhase()) return;
+
 // Next cached table is the module registry (mod_reg)...
 if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
        // Load cache
@@ -67,19 +70,27 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i
                } // END - if
        } // END - foreach
        unset($modArray);
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
        // Create cache file here
-       $GLOBALS['cache_instance']->init('MODULES');
+       $GLOBALS['cache_instance']->init();
 
        // Load all modules and their data
        if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
                // Load has_menu
-               $result = SQL_QUERY('SELECT id, module, title, locked, hidden, admin_only, title, mem_only, has_menu
-FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY `id`', __FILE__, __LINE__);
+               $result = SQL_QUERY('SELECT
+       `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
-               $result = SQL_QUERY('SELECT id, module, title, locked, hidden, admin_only, title, mem_only
-FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY `id`', __FILE__, __LINE__);
+               $result = SQL_QUERY('SELECT
+       `id`, `module`, `title`, `locked`, `hidden`, `admin_only`, `title`, `mem_only`
+FROM
+       `{?_MYSQL_PREFIX?}_mod_reg`
+ORDER BY
+       `module` ASC', __FILE__, __LINE__);
        }
 
        // Cache all data
@@ -94,9 +105,6 @@ FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY `id`', __FILE__, __LINE__);
        // Close the cache
        $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
        $GLOBALS['cache_instance']->finalize();
-
-       // Include loader again
-       loadInclude('inc/loader/'.basename(__FILE__));
 }
 
 // [EOF]