[BUGFIX] Unset stdWrap of select.pidInList
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_eidtools.php
index 1260441..814b7f6 100644 (file)
  *
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *   71: public static function initFeUser()
- *   98: public static function connectDB()
- *  117: public static function initLanguage($language = 'default')
- *  131: public static function initTCA()
- *  150: public static function initExtensionTCA($extensionKey)
- *  167: private static function getTSFE()
- *
- * TOTAL FUNCTIONS: 6
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
 
 /**
  * Tools for scripts using the eID feature of index.php
@@ -90,16 +76,13 @@ final class tslib_eidtools {
         * @return      boolean         TRUE if connection was successful
         */
        public static function connectDB()      {
-               static $dbConnected = FALSE;
-
-               if (!$dbConnected) {
-                       // Attempt to connect to the database
-                       if ($GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password) &&
-                                       $GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) {
-                               $dbConnected = TRUE;
-                       }
+               if (!$GLOBALS['TYPO3_DB']->isConnected()) {
+                               // Attempt to connect to the database
+                       $GLOBALS['TYPO3_DB']->connectDB();
                }
-               return $dbConnected;
+                       // connectDB() throws exceptions if something went wrong,
+                       // so we are sure that connect was successful here.
+               return TRUE;
        }
 
        /**