[TYPO3-dev] How to get the extension typoscript configurationinside an eID script?

Peter Klein pmk at io.dk
Sun Nov 15 22:45:24 CET 2009


No.
I have only used it in a BE hook, not an eID script.

--
Peter Klein

"Ries van Twisk" <typo3 at rvt.dds.nl> wrote in message 
news:mailman.4741.1258318882.595.typo3-dev at lists.typo3.org...
> Peter,
>
> do you happen to do any measurements of that in the past in
> comparison with using a page type?
>
> Ries
>
> I wonder what the minimum response times are for this
> On Nov 15, 2009, at 3:41 PM, Peter Klein wrote:
>
>> If you don't need a full TSFE and only need to access some config
>> vars/options, then you can do something like this:
>>
>> /* Classes required for creating a tmpl object */
>> require_once(PATH_t3lib."class.t3lib_extobjbase.php");
>> require_once(PATH_t3lib."class.t3lib_tsparser_ext.php");
>> require_once(PATH_t3lib."class.t3lib_page.php");
>>
>>    $pageId = <SET THIS TO THE ID OF THE CURRENT PAGE>;
>>
>>   $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");
>>   $tmpl->tt_track = 0; // Do not log time-performance information
>>   $tmpl->init();
>>   // Gets the rootLine
>>   $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
>>   $rootLine = $sys_page->getRootLine($pageId);
>>   // This generates the constants/config + hierarchy info for the 
>> template.
>>   $tmpl->runThroughTemplates($rootLine,0);
>>   $tmpl->generateConfig();
>>
>>    // Example: Get the TS config for the tt_news plugin
>>   $ttnewsConf = $tmpl->setup['plugin.']['tt_news.'];
>>
>> --
>> Peter Klein
>>
>>
>> "Patrick Broens" <patrick at netcreators.com> wrote in message
>> news:mailman.1.1258314437.19621.typo3-dev at lists.typo3.org...
>>> Ries van Twisk wrote:
>>>>
>>>> On Nov 14, 2009, at 5:03 PM, Thomas Thasmo Deinhamer wrote:
>>>>
>>>>> Good evening!
>>>>>
>>>>> Does there exist a nifty way to get the final extension
>>>>> typoscript configuration inside an eID script?
>>>>>
>>>>> I wanna use eID for performance reasons,
>>>>> but can't use it without typoscript configuration.
>>>>>
>>>>> How's this done?
>>>>>
>>>>> Thanks a lot! =o)
>>>>
>>>> it's not...
>>> It is ;-)
>>>
>>> But you need to initialize tslib_fe, which is a huge overhead for  Ajax
>>> functionality.
>>>
>>> First you make an instance of the tslib_fe class like:
>>> $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe',
>>> $GLOBALS['TYPO3_CONF_VARS'],
>>> t3lib_div::_GP('id'),
>>> t3lib_div::_GP('type'),
>>> and more variables if you want
>>> );
>>> (please check your incoming values ;-)
>>>
>>> Do some other stuff (check if you need this)
>>> $GLOBALS['TSFE']->connectToMySQL();
>>> $GLOBALS['TSFE']->initFEuser();
>>> $GLOBALS['TSFE']->determineId();
>>> $GLOBALS['TSFE']->getCompressedTCarray();
>>> $GLOBALS['TSFE']->initTemplate();
>>> $GLOBALS['TSFE']->getConfigArray();
>>>
>>> And you can get the configuration at:
>>> $configuration =
>>> $GLOBALS['TSFE']->tmpl->setup['plugin.'] 
>>> ['tx_yourextension_controller.'];
>>>
>>> It's not really recommended, but it is doable.
>>>
>>> Patrick
>>>>
>>>> let me explain,
>>>>
>>>> if you need typoscript AND you need eID,
>>>> then you are out of luck.
>>>>
>>>> Usually if you need typoscript using some sort of Ajax call,
>>>> then use a proper type number, it's not a lot slower
>>>> then using typoscript within your eID (never made in serious
>>>> measurements though...
>>>>
>>>> Depending on what you are doing, there are several solutions.
>>>>
>>>> What I did here http://www.cocktailsoftheworld.com/find-a-cocktail.html
>>>> with
>>>> my Ajax(eID calls it to prepare the complete list of ingredients and
>>>> Cocktail
>>>> names ands store them as a file. Then use that file within my eID.
>>>>
>>>> If that method can work for you, highly depends on what you are 
>>>> doing...
>>>>
>>>> Ries
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>> _______________________________________________
>> TYPO3-dev mailing list
>> TYPO3-dev at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>
>
> regards, Ries van Twisk
>
> -------------------------------------------------------------------------------------------------
> tags: Freelance TYPO3 Glassfish JasperReports JasperETL Flex Blaze-DS 
> WebORB PostgreSQL DB-Architect
> email: ries at vantwisk.nl        web:   http://www.rvantwisk.nl/     skype: 
> callto://r.vantwisk
> Phone: +1-810-476-4196    Cell: +593 9901 7694                   SIP: 
> +1-747-690-5133
>
>
>
>
>
>
> 






More information about the TYPO3-dev mailing list