Project

General

Profile

Actions

Bug #50926

closed

documentation is misleading in some points

Added by Knut Behrends over 11 years ago. Updated almost 9 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 #1

Updated by Michael Stucki almost 11 years ago

  • Project changed from 329 to TYPO3 Core
Actions #2

Updated by Michael Stucki almost 11 years ago

  • Category set to 999
Actions #3

Updated by Mathias Schreiber almost 10 years ago

  • Assignee set to Andreas Kienast
  • Target version set to 7.5
  • Is Regression set to No

Hey Andy,
thoughts?

Actions #4

Updated by Andreas Kienast almost 10 years ago

I have to investigate if this is still an issue.

Actions #5

Updated by Morton Jonuschat over 9 years ago

  • Status changed from New to Needs Feedback

The relevant parts of the code are still there, but from my understanding of the code $this->link is the default connection, this and all other links are also stored in $this->handlerInstance[$handlerKey]['link']. The latter is being used throughout DatabaseConnection, $this->link is never being accessed.

Actions #6

Updated by Benni Mack about 9 years ago

  • Target version deleted (7.5)
Actions #7

Updated by Alexander Opitz almost 9 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Andreas Kienast)

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF