[TYPO3-core] RFC #9974: Use PHP built--in gzip/deflate compression in Frontend

Thorsten Kahler thorsten.kahler at dkd.de
Sat Feb 21 23:01:01 CET 2009


Hi Dmitry!

Dmitry Dulepov schrieb am 16.02.2009 13:47 Uhr:
>> why should we start placing functions in index_ts.php? I don't
>> really like adding the function to t3lib_div, but that's our 
>> all-pupose-container ATM.
> 
> There are several reasons.
> 
> Firsts, if the function is to be used in a single file, its place is
> in that single file. There is no need to make it available for
> everyone if others are not going to use it.

If the function is not part of a class it's available for everyone as well.

> 
> Secondly, we already talked that it would be great to split t3lib_div
> because it became a huge monster.

That's not the question here. Maybe adding the output handler increases
the pressure to split up t3lib_div.

> Thirdly, I do not feel very comfortable having functions in
> index_ts.php too. I thought at lot about the better place. But
> index_ts.php seems to be the most logical place for the function,
> which works only in this file and not in any other place. I even
> thought about creating a dedicated class for this function but I
> decided that it is too much overhead for the same reason: use only in
> index_ts, extra [slow] inclusion, etc.
> 

That's why I'd prefer t3lib_div: the class is already included and it's
already an accumulation of functions that don't have much in common. No
related functions occur to me ATM so even after splitting up t3lib_div
the function would stay in a rather general class (if at all).

Conclusion:
You reported the issue, you wrote the patch and the issue is assigned to
you. So you should decide. Putting the function into t3lib_div might
make it clearer, that the function can be moved to a different
file/class when it comes to a future code cleanup.

In any case: you get a +1 from me.

Regards
Thorsten



-- 

Thorsten Kahler
thorsten.kahler at dkd.de


More information about the TYPO3-team-core mailing list