[TYPO3-core] RFC #14247: Add a compressor/concatenator for CSS and JS

Helmut Hummel helmut at typo3.org
Sat May 1 15:00:51 CEST 2010


Hi all,

first of all, I tested Susannes patch and I confirm that it worked like
a charm.

But I also have some comments:

On 01.05.10 13:15, Steffen Gebert wrote:
> 
> Will spent some time later on this topic, so here just my comments after
> reading:
> 
>> // check, if $filename starts with $skinStylesheetDirectory (it's
>> position 0, not FALSE!)
>> - if (strpos($filename, $baseDirectory) === 0) {
>> + if (is_int(strpos($filename, $baseDirectory))) {
> Please adjust the comment. But when you didn't change the logic,
> $filename starts with $baseDirectory or doesn't contain it anywhere.
> Ah.. and what comes to my mind: The baseDirectory "stylesheets/visual/"
> can also be included in
> EXT:iamnotaskin/stylesheets/visual/style-for-my-specific-module.css
> So I'm still for checking for position 0.

I also stumbled over this one as I don't like the is_int(strpos()) too
much as it's not too descriptive. If we want to check if a string is the
first part of another string, I suggest to use:

t3lib_div::isFirstPartOfString() since it does what the function name says.

However changing this, did not work because some filenames looked like this:

../typo3temp/compressor/BE-compressed....css

which was compared with typo3temp/compressor/ so checking for position 0
(or first part of string) did not work.

>> // leave files not in the stylesheet directories uncompressed
> Why this? I would compress everything, except it is set to compress =
> FALSE in PageRenderer. Therefore we should be able to get those files to
> exclude in the paramter $options from PageRenderer.

Well, this is a design decision, which was implemented in the API of the
compressor class. I cannot say anthing about, why this is important.


Lookin at these issues, I think we should really introduce some unit
tests for the new t3lib_compressor, and probably also add additional
tests for the pagerenderer.

I would do this, but need some help, because I'm not too much into unit
testing espacially when it comes to protected methods to be tested.

Oliver (Klee) could you help me out? :)

Regards Helmut


More information about the TYPO3-team-core mailing list