Project

General

Profile

Actions

Bug #50926

closed

documentation is misleading in some points

Added by Knut Behrends over 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2013-08-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The documentation contains this example of a configuration, p.6

Using another MySQL database for the “tt_guest” and “sys_note” tables

1: $TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array (
2:         '_DEFAULT' => array (
3:             'type' => 'native',
4:             'config' => array(
5:                 'username' => '',        // Set by default (overridden)
6:                 'password' => '',        // Set by default (overridden)
7:                 'host' => '',            // Set by default (overridden)
8:                 'database' => '',        // Set by default (overridden)
10:             )
11:         ),
12:         'alternativeMySQLdb' => array (
13:             'type' => 'native',
14:             'config' => array(
15:                 'username' => 'your_username',        
16:                 'password' => 'your_password',        
17:                 'host' => 'localhost',        
18:                 'database' => 'alternative_database_name',        
19:             )
20:         ),
21:     );
22:

However, the 'alternativeMySQLdb' configuration would never be created successfully with the current dbal extension.

This code on line 3068 in file
class.ux_t3lib_db.php
prevents that the "link " property is assigned for any mysql-configurations that are registered as "native" but not registered as "_DEFAULT"

if ($link) {
// For default, set ->link (see t3lib_DB)
if ($handlerKey == '_DEFAULT') {
$this->link = $link;
}

/* I have replaced it with this */

// If link succeeded:
if ($link) {
// For default, set ->link (see t3lib_DB)
//if ($handlerKey == '_DEFAULT') {
$this->link = $link;
//}
//error_log("handlerKey $handlerKey");

Maybe there is a better way to do this. Just saying.

My dbal version: 4-7-7

Actions

Also available in: Atom PDF