From 4da10ba9e4a47d9b4eee4609a185fc7266fab031 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 4 Jun 2016 12:24:09 +0200 Subject: [PATCH] Continued a bit: - introduced doNormalBootstrap() - First check for mysqli, then obsolete mysql MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/mysql-connect.php | 28 ++++++++-------------------- inc/purge/purge-tasks.php | 4 +++- inc/wrapper-functions.php | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 1e596c3a8c..513b391e66 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -97,20 +97,8 @@ enableTemplateHtml(); // Are we in installation phase? if ((!isInstaller()) && (isInstalled())) { - // Load configuration file(s) here - loadIncludeOnce('inc/load_config.php'); - - // Load database layer here - loadIncludeOnce('inc/db/lib.php'); - - // Init message system - initMessages(); - - // CSS array - initExtensionCssFiles(); - - // Initialize SQL link - initSqlLink(); + // Regular bootstrap + doNormalBootstrap(); } else { // Default output is 'direct' for HTML output setConfigEntry('OUTPUT_MODE', 'direct'); @@ -129,18 +117,18 @@ if ((!isInstaller()) && (isInstalled())) { // Then take it from session /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Setting _DB_TYPE from session;database_extension=' . getSession('database_extension')); setConfigEntry('_DB_TYPE', getSession('database_extension')); - } elseif (isPhpExtensionLoaded('mysql')) { - // Debug message - /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Setting _DB_TYPE to default (mysql) ...'); - - // Set (old) default - setConfigEntry('_DB_TYPE', 'mysql'); } elseif (isPhpExtensionLoaded('mysqli')) { // Debug message /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Setting _DB_TYPE to MySQLi ...'); // Set (old) default setConfigEntry('_DB_TYPE', 'mysqli'); + } elseif (isPhpExtensionLoaded('mysql')) { + // Debug message + /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Setting _DB_TYPE to default (mysql) ...'); + + // Set (old) default + setConfigEntry('_DB_TYPE', 'mysql'); } else { // Opps, cannot detect it? reportBug(__FILE__, __LINE__, 'Cannot detect mysql/mysqli. Please fix your setup.'); diff --git a/inc/purge/purge-tasks.php b/inc/purge/purge-tasks.php index 2341ea145e..b8aa028d02 100644 --- a/inc/purge/purge-tasks.php +++ b/inc/purge/purge-tasks.php @@ -61,7 +61,9 @@ FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `status`='DELETED' AND - (UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__); + (UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?} +ORDER BY + `id` ASC", __FILE__, __LINE__); // Send out a notification? if (!ifSqlHasZeroNumRows($result)) { diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 3f7f91ed11..4ac0eeeffb 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -3606,5 +3606,23 @@ function setSessionCompiled ($key, $value) { return setSession($key, $value); } +// Does normal bootstrap +function doNormalBootstrap () { + // Load configuration file(s) here + loadIncludeOnce('inc/load_config.php'); + + // Load database layer here + loadIncludeOnce('inc/db/lib.php'); + + // Init message system + initMessages(); + + // CSS array + initExtensionCssFiles(); + + // Initialize SQL link + initSqlLink(); +} + // [EOF] ?> -- 2.39.5