Fixes for running SQL queries
authorRoland Häder <roland@mxchange.org>
Fri, 19 Dec 2008 19:07:21 +0000 (19:07 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 19 Dec 2008 19:07:21 +0000 (19:07 +0000)
inc/databases.php
inc/extensions.php
inc/filters.php

index adaafd37fbf6da04752a01310a4c0f1503c4de22..74f0cb3ba477f74b0b3ae9b96c45111113f3e778 100644 (file)
@@ -115,7 +115,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "677");
+define('CURR_SVN_REVISION', "678");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 19405263086cddc90ae61dcb3998a40df76b19f6..84c6d4be5d9e66079c0c177b8f8a63070d72a781 100644 (file)
@@ -492,7 +492,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
                } // END - if
 
                // Run SQLs
                } // END - if
 
                // Run SQLs
-               RUN_FILTER('run_sqls', $dry_run);
+               RUN_FILTER('run_sqls', array('dry_run' => $dry_run, 'sqls' => $SQLs));
 
                if (!$dry_run) {
                        // Create task
 
                if (!$dry_run) {
                        // Create task
index 0fc19fa5527b4408f9d42d6e94074e5c2b0c11ce..1355975dd7c81e50fe950f1a26226e73cb33d343 100644 (file)
@@ -319,7 +319,7 @@ function FILTER_FLUSH_FILTERS () {
        } // END - if
 
        // Run the run_sqls filter in non-dry mode
        } // END - if
 
        // Run the run_sqls filter in non-dry mode
-       RUN_FILTER('run_sqls', false);
+       RUN_FILTER('run_sqls', array('dry_run' => false, 'sqls' => $SQLs));
 }
 
 // Filter for calling the handler for login failtures
 }
 
 // Filter for calling the handler for login failtures
@@ -419,13 +419,11 @@ function FILTER_LOAD_INCLUDES ($data) {
 }
 
 // Filter for running SQL commands
 }
 
 // Filter for running SQL commands
-function FILTER_RUN_SQLS ($dry_run) {
-       global $SQLs;
-
+function FILTER_RUN_SQLS ($data) {
        // Is the array there?
        // Is the array there?
-       if ((is_array($SQLs)) && (!$dry_run)) {
+       if ((isset($data['sqls'])) && ((!isset($data['dry_run'])) || ($data['dry_run'] == false))) {
                // Run SQL commands
                // Run SQL commands
-               foreach ($SQLs as $sql) {
+               foreach ($data['sqls'] as $sql) {
                        $sql = trim($sql);
                        if (!empty($sql)) {
                                // Do we have an "ALTER TABLE" command?
                        $sql = trim($sql);
                        if (!empty($sql)) {
                                // Do we have an "ALTER TABLE" command?
@@ -438,10 +436,7 @@ function FILTER_RUN_SQLS ($dry_run) {
                                }
                        } // END - if
                } // END - foreach
                                }
                        } // END - if
                } // END - foreach
-       } elseif (GET_EXT_VERSION("sql_patches") == "") {
-               // Remove SQLs if extension is not installed
-               $SQLs = array();
-       }
+       } // END - if
 }
 
 // Filter for updating/validating login data
 }
 
 // Filter for updating/validating login data