[TYPO3-core] RFC: #15754: ExtDirect in Frontend

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Sep 21 17:53:42 CEST 2010


Martin Kutschker schrieb am 21.09.2010 17:41:
> Am 21.09.2010 01:25, schrieb Stefan Galinski:
>> Hi,
>>
>> this is a SVN patch request.
>>
>> Type: Feature
>>
>> BT Reference: http://bugs.typo3.org/view.php?id=15754
>>
>> Branches: trunk
>>
>> Problem:
>> Currently it's not possible to use ExtDirect in the frontend.
>>
>> Solution:
>> Add an eId class that provides the necessary methods to use ExtDirect in frontend.
> 
> Question: is it ok by the CGL to have a class.*.php file to include more than a class? I dislike
> very much this auto-instantiation scheme. It defeats IMHO the whole idea of the file naming scheme.

An eID "script" needs to be executeable, because this is what
index_ts.php does when a eID request is to be dispatched:

        if ($classPath =
t3lib_div::getFileAbsFileName($TYPO3_CONF_VARS['FE']['eID_include'][$temp_extId]))
    {
                // Remove any output produced until now
                ob_clean();

                require($classPath);
        }
        exit;

So the require'd class needs to be executed. Galinski just then placed
the code to be executed inside a class, I think it is ok, else you would
end up with just another tiny file just to instanciate the object.

What I think could be still improved (sorry for the late idea) is to
skip the "require_once" in the class, as we have auto-loading in place
already (it is set up during config_default.php parsing, so it is
available even in this eID context).

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list