Bug #17376 ยป 0005774.patch
typo3/sysext/dbal/class.ux_t3lib_db.php (Arbeitskopie) | ||
---|---|---|
if (is_array($cfgArray)) {
|
||
switch($handlerType) {
|
||
case 'native':
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect']) {
|
||
// If working with two or more databases on the same server at once, persistent links are not working:
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'] || count($this->handlerInstance)) {
|
||
$link = mysql_connect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''), $cfgArray['config']['username'], $cfgArray['config']['password'], true);
|
||
// Use a persistent connection:
|
||
} else {
|
||
$link = mysql_pconnect($cfgArray['config']['host'].(isset($cfgArray['config']['port']) ? ':'.$cfgArray['config']['port'] : ''), $cfgArray['config']['username'], $cfgArray['config']['password']);
|
||
}
|
||
... | ... | |
// If link succeeded:
|
||
if ($link) {
|
||
// For default, set ->link (see t3lib_DB)
|
||
if ($handlerKey == '_DEFAULT') {
|
||
$this->link = $link;
|
||
}
|
||
// Select database as well:
|
||
if (mysql_select_db($cfgArray['config']['database'], $link)) {
|
||
$output = TRUE;
|
||
}
|
||
$setDBinit = t3lib_div::trimExplode(chr(10), $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'], 1);
|
||
foreach ($setDBinit as $v) {
|
||
if (mysql_query($v, $this->link) === FALSE) {
|
||
t3lib_div::sysLog('Could not initialize DB connection with query "'.$v.'".','Core',3);
|
||
// For default, set ->link (see t3lib_DB)
|
||
if ($handlerKey == '_DEFAULT') {
|
||
$this->link = $link;
|
||
$setDBinit = t3lib_div::trimExplode(chr(10), $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'], 1);
|
||
foreach ($setDBinit as $v) {
|
||
if (mysql_query($v, $this->link) === FALSE) {
|
||
t3lib_div::sysLog('Could not initialize DB connection with query "'.$v.'".','Core',3);
|
||
}
|
||
}
|
||
}
|
||
} else {
|