[BUGFIX] Unset stdWrap of select.pidInList
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_eidtools.php
index 518c697..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;
        }
 
        /**
@@ -127,7 +110,7 @@ final class tslib_eidtools {
                // TCA is still loaded if such bad extensions are installed
                if (!is_array($GLOBALS['TCA']) || !isset($GLOBALS['TCA']['pages'])) {
                        // Load TCA using TSFE
-                       self::getTSFE()->includeTCA(false);
+                       self::getTSFE()->includeTCA(FALSE);
                }
        }
 
@@ -158,7 +141,7 @@ final class tslib_eidtools {
         */
        private static function getTSFE() {
                // Cached instance
-               static $tsfe = null;
+               static $tsfe = NULL;
 
                if (is_null($tsfe)) {
                        $tsfe = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 0, 0);