Fixed bug #14628: Open t3lib_db for own instance
authorSteffen Kamper <info@sk-typo3.de>
Wed, 9 Jun 2010 15:28:12 +0000 (15:28 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 9 Jun 2010 15:28:12 +0000 (15:28 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7849 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_db.php

index 7fdc04e..2f8d73a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-06-08  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14628: Open t3lib_db for own instance
        * Follow-up to bug #8305: SQL debug output is not shown in the Backend
        * Fixed bug #14618: Bug: Add debug feature to Ext Direct (Thanks to Fabien Udriot)
        * Follow-up to bug #8305: SQL debug output is not shown in the Backend
index 64b7f62..11bf3f2 100644 (file)
@@ -1314,18 +1314,22 @@ class t3lib_DB {
        /**
         * Connects to database for TYPO3 sites:
         *
+        * @param string $host
+        * @param string $user
+        * @param string $password
+        * @param string $db
         * @return      void
         */
-       function connectDB() {
-               if ($this->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
-                       if (!TYPO3_db) {
+       function connectDB($host = TYPO3_db_host, $user = TYPO3_db_username, $password = TYPO3_db_password, $db = TYPO3_db) {
+               if ($this->sql_pconnect($host, $user, $password)) {
+                       if (!$db) {
                                throw new RuntimeException(
                                        'TYPO3 Fatal Error: No database selected!',
                                        1270853882
                                );
-                       } elseif (!$this->sql_select_db(TYPO3_db)) {
+                       } elseif (!$this->sql_select_db($db)) {
                                throw new RuntimeException(
-                                       'TYPO3 Fatal Error: Cannot connect to the current database, "' . TYPO3_db . '"!',
+                                       'TYPO3 Fatal Error: Cannot connect to the current database, "' . $db . '"!',
                                        1270853883
                                );
                        }