X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload-modules.php;h=03fd6c9bd36fac15eeec3b1b70eee3921d244be1;hb=6bd47661d7ec406cd276f0835364b1e3f933d6c8;hp=4ace00bb02ffa0f7b2614646a9a66b8cee088a1c;hpb=7d61cd8a78e4f9afc42888759523e8069e75102a;p=mailer.git diff --git a/inc/loader/load-modules.php b/inc/loader/load-modules.php index 4ace00bb02..03fd6c9bd3 100644 --- a/inc/loader/load-modules.php +++ b/inc/loader/load-modules.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 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 * @@ -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=
'.print_r($modArray, true).'
'); + // Try to remove the cache file + $GLOBALS['cache_instance']->removeCacheFile(); + + // We should fix this + reportBug(__FILE__, __LINE__, 'modArray=
' . print_r($modArray, TRUE) . '
Please try to reload to fix this.'); } // END - if // Rewrite some parts @@ -65,7 +68,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i // Is ext-sql_patches newer or equal 0.3.6? if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) { // Add 'has_menu' - $entries[] = 'has_menu'; + array_push($entries, 'has_menu'); } // END - if // Add all @@ -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 + // Is there 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);