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

Martin Kutschker masi-no at spam-typo3.org
Fri Sep 12 21:55:39 CEST 2008


Dmitry Dulepov [typo3] schrieb:
> Hi!
> 
> Martin Kutschker wrote:
>> 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.
> 
> No one will be able to call this function second time ;) Here is why
> (from t3lib_db):

In this case it would be better not to call $TYPO3_DB->connectDB()
directly, but use the underlying public function $TYPO3_DB->sql_pconnect().

Die'ing in a library function sucks!

Alternatively I'm open to change $TYPO3_DB->connectDB() so that it takes
a parameter telling it not to die on error. Instead of dying it could
either report FALSE, return an error message or throw an exception.

Anyway for tslb_eidttools I think a die with an error message is not the
right choice as it might be used in an AJAX or other non HTML contexts.

Masi


More information about the TYPO3-team-core mailing list