[TYPO3-core] RFC: #9318: Enhance and fix tslib_eidtools

Martin Kutschker masi-no at spam-typo3.org
Fri Sep 12 10:37:47 CEST 2008


Dmitry Dulepov [typo3] schrieb:
> Hi!
> 
> Martin Kutschker wrote:
>> connectDB() never sets it's static variable $dbConnected to true. I
>> guess you wanted to write (assuming it reportes success with a boolean):
>>
>> $dbConnected = $GLOBALS['TYPO3_DB']->connectDB();
> 
> You are right, my mistake. I fixed it, except that I always set it to
> true, regardless of connection result. It does not make sense to connect
> again if connection already failed.

Why? It could be a temporary failure (eg a machine short of
connections). And furthermore the script will continue and happily try
to access the DB, when in fact no connection exists.

Please change it at least so, that the method reports if the connection
failed. This would of course change the meaning of $dbConnected to
$triedToConnectToDb.

Masi


More information about the TYPO3-team-core mailing list