[TYPO3-dev] extra helper files in plugin -> how to access db ?

Steffen Ritter info at rs-websystems.de
Fri Jan 30 14:19:55 CET 2009


Henjo Hoeksma schrieb:
> On 2009-01-29 07:10:34 +0100, Steffen Ritter <info at rs-websystems.de> said:
> 
>> Hi,
>> I just did not get the point why you cannot use the TYPO3-Database Api 
>> for Building this file?
>>
>> kind regards
>>
>> Steffen
> 
> Hi Steffen,
> 
> thank you for replying.
> 
> Actually that is what I wanted. How can I achieve this? I required 
> different files to be included all resulting in errors. I have not found 
> a way to have this file be part of the extension as a whole so I have 
> access to the API inside of this 'aside standing' script?
> 
> That would be the ideal situation I guess. I seem to miss how to get 
> this done properly.
> 
> Thanks in advance.
> 
> Henjo

The cleanest way would be: use Eid ...

in your php file just put
	$GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host,TYPO3_db_username, 
TYPO3_db_password);
$GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db);

to initiate the DB...

But this envirement needs to set up by TYPO3...
For such functionality, do not call your script directly.

Add
$TYPO3_CONF_VARS['FE']['eID_include']['generateMyXML'] = 
'EXT:'.$_EXTKEY.'/class.the_phpfile generating my stuff.php';



and call the script via mydoomain.com/index.php?eId=generateMyXML

If you just not wnat To do this, you have to include the DB Classes and 
Localconf Yourself before creating the DB Object

hope this will help you




More information about the TYPO3-dev mailing list