Fixed bug #14254: Fresh install does not redirect to Install Tool when mysql is not...
authorXavier Perseguers <typo3@perseguers.ch>
Fri, 30 Apr 2010 15:12:22 +0000 (15:12 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Fri, 30 Apr 2010 15:12:22 +0000 (15:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7459 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_db.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index 49b808c..141e00f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-30  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Fixed bug #14254: Fresh install does not redirect to Install Tool when mysql is not available
+
 2010-04-30  Christian Kuhn  <lolli@schwarzbu.ch>
 
        * Fixed bug #14256: tslib_cObj has two test case files (Thanks to Oliver Klee)
index 0bf8ea6..62e604a 100644 (file)
@@ -1081,10 +1081,8 @@ class t3lib_DB {
 
                        // check if MySQL extension is loaded
                if (!extension_loaded('mysql')) {
-                       $header = 'Database Error';
-                       $message = 'It seems that MySQL support for PHP is not installed!';
-                       t3lib_timeTrack::debug_typo3PrintError($header, $message, false, t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
-                       exit;
+                       $message = 'Database Error: It seems that MySQL support for PHP is not installed!';
+                       throw new RuntimeException($message, 1271492606);
                }
 
                        // Check for client compression
index bbde061..35c8024 100644 (file)
         * @return      void
         */
        function connectToDB()  {
-               if ($GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password))    {
+               try {
+                       $link = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password);
+               } catch (RuntimeException $e) {
+                       if (TYPO3_db) {
+                                       // Database is defined, this should normally not happen, user should be informed
+                               throw $e;
+                       }
+                       $link = FALSE;
+               }
+               if ($link !== FALSE) {
                        if (!TYPO3_db)  {
                                $this->printError('No database selected','Database Error');
                                        // Redirects to the Install Tool: