Fixes for installation phase
authorRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2009 18:10:16 +0000 (18:10 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2009 18:10:16 +0000 (18:10 +0000)
16 files changed:
inc/extensions-functions.php
inc/extensions/ext-other.php
inc/filter-functions.php
inc/filters.php
inc/load_cache.php
inc/loader/load_cache-
inc/loader/load_cache-admin.php
inc/loader/load_cache-config.php
inc/loader/load_cache-extension.php
inc/loader/load_cache-filter.php
inc/loader/load_cache-impressum.php
inc/loader/load_cache-modules.php
inc/loader/load_cache-refdepths.php
inc/loader/load_cache-refsystem.php
inc/loader/load_cache-them.php
inc/mysql-connect.php

index 359b09fe45e45d5a3ae7bd93e0279d4c48b2a8a1..daac4a821839455afe07eb3d7bca7ec1fbee2067 100644 (file)
@@ -614,7 +614,7 @@ function updateExtension ($ext_name, $ext_ver, $dry_run = false) {
                                        setCurrentExtensionName($ext_depend);
 
                                        // Is the extension there?
-                                       if (isExtensionInstalled()) {
+                                       if (isExtensionInstalled($ext_depend)) {
                                                // Update another extension first!
                                                $test = updateExtension($ext_depend, getExtensionVersion($ext_depend), getExtensionDryRun());
                                        } else {
index cd8ed9f78cfa6123a53907c65657906e3fe2d7cc..8520a0993ec65bfd72eab723c3cecd599eefa520 100644 (file)
@@ -42,10 +42,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.2.2');
+setThisExtensionVersion('0.2.3');
 
 // Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2'));
+setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -203,6 +203,13 @@ switch (getExtensionMode()) {
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("(Fast) alle SQL-Abfragen lassen sich nun zu Debugging-Zwecken (!) einschalten. Nur der Administrator sieht diese unten am Ende der Seite.");
                                break;
+
+                       case '0.2.3': // SQL queries for v0.2.3
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `max_send` BIGINT(20) NOT NULL DEFAULT 10");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Fehlende Konfiguration hinzugef&uuml;gt.");
+                               break;
                }
                break;
 
index b8f8313e2fe270a3bed075db379f34d54614cf7b..274ded1875e60b1975ac21e9ee741694ffdaf913 100644 (file)
@@ -49,15 +49,15 @@ function initFilterSystem () {
                debug_report_bug(getMessage('FILTER_FAILED_ALREADY_INIT'));
        } // END - if
 
-       // Init dummy array
-       $filterArray = array(
-               'chains'  => array(),
-               'loaded'  => array(),
-               'counter' => array()
-       );
-
        // Load all saved filers if sql_patches is updated
        if (isset($GLOBALS['cache_array']['filter']['filter_name'])) {
+               // Init dummy array
+               $filterArray = array(
+                       'chains'  => array(),
+                       'loaded'  => array(),
+                       'counter' => array()
+               );
+
                // Found in cache so rewrite the array
                foreach ($GLOBALS['cache_array']['filter']['filter_name'] as $idx => $filterName) {
                        // Get filter function
@@ -74,7 +74,7 @@ function initFilterSystem () {
 
                // Remove the cache
                $GLOBALS['cache_array']['filter'] = $filterArray;
-       } elseif (isExtensionInstalledAndNewer('sql_patches', '0.5.9')) {
+       } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
                // Init add
                $add = '';
                if (getExtensionVersion('sql_patches') >= '0.6.0') $add = ", `filter_counter`";
@@ -201,7 +201,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for
                } // END - if
 
                // Simply add it to the array
-               //* DEBUG: */ print 'filterName='.$filterName.',filterFunction='.$filterFunction.'<br />';
+               //* DEBUG: */ print __FUNCTION__.': filterName='.$filterName.',filterFunction='.$filterFunction.'<br />';
                $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'A';
                $GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = 0;
        } // END - if
@@ -224,6 +224,7 @@ function unregisterFilter ($filterName, $filterFunction, $force = false, $dry_ru
        // Shall we remove? (default, not while just showing an extension removal)
        if ($dry_run === false) {
                // Mark for filter removal
+               //* DEBUG: */ print __FUNCTION__.': filterName='.$filterName.',filterFunction='.$filterFunction.'<br />';
                $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
        } // END - if
 }
@@ -233,9 +234,9 @@ function runFilterChain ($filterName, $data = null) {
        // Is that filter chain there?
        if (!isset($GLOBALS['cache_array']['filter']['chains'][$filterName])) {
                // We should find all these non-existing filter chains
-               if ($filterName != 'sql_admin_extra_data') {
-                       /* Only for tracking: */ debug_report_bug('Filter chain <strong>' . $filterName . '</strong> not found!');
-               }
+               /* Only for tracking: */ if ($filterName != 'sql_admin_extra_data') {
+               /* Only for tracking: */ debug_report_bug('Filter chain <strong>' . $filterName . '</strong> not found!');
+               /* Only for tracking: */ }
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' not found!');
 
                // Abort here and return content
index 1d7a5004760d661695a464d82faa6a6a84cd918f..1b26cddabb587c8d6bdbb2372242e0cbc950aad2 100644 (file)
@@ -580,6 +580,16 @@ function FILTER_HTML_INCLUDE_USERS ($mode) {
 
 // Filter for determining what/action/module
 function FILTER_DETERMINE_WHAT_ACTION () {
+       // In installation phase we don't have what/action
+       if (isInstallationPhase()) {
+               // Set both to empty
+               setAction('');
+               setWhat('');
+
+               // Abort here
+               return;
+       } // END - if
+
        // Get all values
        if ((getOutputMode() != 1) && (getOutputMode() != -1)) {
                // Fix module
index cb35e6adf9e9d2770e471b2fdd77e6bf21462058..92db387cdb4a936b2f3f39eee005f590e8382678 100644 (file)
@@ -43,7 +43,6 @@ if (!defined('__SECURITY')) {
 
 // Init cache instance and array
 $GLOBALS['cache_instance'] = null;
-$GLOBALS['cache_array'] = array();
 
 // Init cache first
 initCacheInstance();
index 548c05e6b8ed1a28aa4ef03c6f3adb477de5357d..4ff35f91e6e2e5248d8df0c420ee905e223bb9ff 100644 (file)
@@ -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;
+
 // Let's start with the admins table...
 if (($GLOBALS['cache_instance']->loadCacheFile('foo')) && ($GLOBALS['cache_instance']->extensionVersionMatches('foo'))) {
        // Load cache
index cc4ae544b48862f85c7b67f7b46b7a8de95bb780..93e862d4c5f60c241ba992574b923241f07acc18 100644 (file)
@@ -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;
+
 // Let's start with the admins table...
 if (($GLOBALS['cache_instance']->loadCacheFile('admins')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) {
        // Load cache
index 8fd6c9aecfd5fd7d6d9c2432ec2e0dd1ce085aa8..bb4c47583524c6856167acd478545f9f5937d02b 100644 (file)
@@ -41,6 +41,9 @@ if (!defined('__SECURITY')) {
        die();
 }
 
+// Use this code if you don't want to run this cache loader on installation phase
+if (isInstallationPhase()) return;
+
 // Next cached table is the configuration (config)...
 if (($GLOBALS['cache_instance']->loadCacheFile('config')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
        // Load config from cache
index d765f85846991b6f072a894d730cae44cf8d0be4..7ccaf9f4c962037139aa62d454d83f311d876871 100644 (file)
@@ -43,6 +43,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 extension
 if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
        // Load extension from cache
index b158b05f9929c47aa7aef93d58513e6782baa658..74bff13b68459895400d8fd2b914c3b18cf978cc 100644 (file)
@@ -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 filteruration (filter)...
 if (($GLOBALS['cache_instance']->loadCacheFile('filter')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
        // Load filter from cache
index 20ed9562b6f99a80dde2e39ec4fe03fd694d852a..ce165d830e4b7f4f62435fb148064019b6438193 100644 (file)
@@ -44,6 +44,9 @@ if (!defined('__SECURITY')) {
        return;
 }
 
+// Use this code if you don't want to run this cache loader on installation phase
+if (isInstallationPhase()) return;
+
 // Let's start with the admins table...
 if (($GLOBALS['cache_instance']->loadCacheFile('imprint')) && ($GLOBALS['cache_instance']->extensionVersionMatches('imprint'))) {
        // Load cache
index 8c66caa8a5e6066a53fb15698a227a681c02130a..a1152a0d77e27d0ff7839b58fcedbd114218f19f 100644 (file)
@@ -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
index 7b3b3157d2ddf2a60043712d9f74246d610c3828..5bb6ab76d832c019e33b69e988b1474b6f7a2788 100644 (file)
@@ -41,6 +41,9 @@ if (!defined('__SECURITY')) {
        die();
 }
 
+// Use this code if you don't want to run this cache loader on installation phase
+if (isInstallationPhase()) return;
+
 // Next cached table is the referal system (refdepths)...
 if (($GLOBALS['cache_instance']->loadCacheFile('refdepths')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
        // Load referal system from cache
index 06dee6c577231a3f3f29a6a4b3eda3b9a425b167..c60475c1b3b4529a314fbe055f9f9d07c0d05e6d 100644 (file)
@@ -41,6 +41,9 @@ if (!defined('__SECURITY')) {
        die();
 }
 
+// Use this code if you don't want to run this cache loader on installation phase
+if (isInstallationPhase()) return;
+
 // Next cached table is the referal system (refsystem)...
 if (($GLOBALS['cache_instance']->loadCacheFile('refsystem')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
        // Load referal system from cache
index da82aac80e20248ccd3617a9191baebdf946e0b6..cbf87063a7bfb016a3b764150899c27a34c84c01 100644 (file)
@@ -44,6 +44,9 @@ if (!defined('__SECURITY')) {
        return false;
 }
 
+// Use this code if you don't want to run this cache loader on installation phase
+if (isInstallationPhase()) return;
+
 // Next cached table is the referal system (themes)...
 if (($GLOBALS['cache_instance']->loadCacheFile('themes')) && ($GLOBALS['cache_instance']->extensionVersionMatches('theme'))) {
        // Load referal system from cache
index 741122f5a8e450b1f1d3d45008fe23de463c72cd..2a325ccc921c0bd795cb16f1ac33147e1be2a64b 100644 (file)
@@ -103,7 +103,7 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
                                // Remove MySQL array from namespace
                                unset($GLOBALS['mysql']);
 
-                               // Administrative functions
+                               // Load cache
                                loadIncludeOnce('inc/load_cache.php');
 
                                // Init filter system
@@ -172,8 +172,8 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
                loadIncludeOnce($inc);
        } // END - foreach
 
-       // Init filter system here
-       initFilterSystem();
+       // Load config
+       loadIncludeOnce('inc/load_config.php');
 
        // Are we installation routine?
        if ((!isInstalling()) && (getOutputMode() != '1') && (getOutputMode() != -1)) {
@@ -181,14 +181,14 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
                redirectToUrl('install.php');
        } // END - if
 
-       // Administrative functions
+       // Init filter system here
+       initFilterSystem();
+
+       // Load cache
        loadIncludeOnce('inc/load_cache.php');
 
        // Run the init filter chain
        runFilterChain('init');
-
-       // Load configuration file(s) here
-       loadIncludeOnce('inc/load_config.php');
 }
 
 // Handle fatal errors