[TYPO3-core] RFC #13998: Introduce Automatic versioning of CSS and JS files

Lars Houmark lars at houmark.com
Fri Apr 9 10:28:43 CEST 2010


Hi Stefano,

> If someone touch exist code or write new code for an bugfix or feature
> he must follow the CGL. So t3lib_div is no good example for following
> the CGL ;-)

Okay, but before enforcing this hardcore, someone should take care of 
adjusting the things in the current core. I mean, adjusting tabs on 
comments should be fairly easy to do in one automated run.

Having said that I was not aware that I should go through the entire 
line that I modify just a bit to fix others missing CGL code.

> To have a first fast overview, please setup your mail client that
> attached files displayed inline.

Unfortunately easier said than done, but I was focussing wrong, because 
I was only looking at my own code.

> Some CGL nitpicking (line numbers are patch v5 related):
> 
> Line 9 and 17:
> Inline comments schould go one line above with one more intention.
> 	// Boolean. If true, ...
> 'versionNumberInFilename' => FALSE,

I am really not sure that is a smart thing, since this config files 
seems to parse the comment and include that as text in the install 
tool. It even seems to be using the "Boolean" value to create a 
checkbox instead of an line field. Also, the entire file is using 
right-side comments, so it would create more trouble to start doing it 
on the line above - and break functionality at the same time.

> Line 43: Spaces before and after the concatenation dot
> Line 69: Space before the concatenation dot

Fixed.

> Line 210: Spaces before and after the assignment operator
> Line 210: Space before the first concatenation dot
> Line 210: Spaces before and after the second concatenation dot
> Line 223: Space before the first concatenation dot
> Line 223: Spaces before and after the second concatenation dot
> Line 236 and 245: Space before the assignment operator (.=)

All of these were existing code, some of them from the very new 
recycler. Makes you think a bit right?

Attached is _v6 with all nitpicks fixed.

On another note:

I have done more testing on several sites and found that the .htaccess 
rule needs some adjusting. If a real file (ie. .js) is constructed like 
this:
mootoolsv1.12.js this will create a problem, since the '12' is stripped.

The fix is RewriteCond lines before the rule, so the entire rule that 
should be around line 56/57 should be:

# Rule for Versioned Static Files for the backend (and in the future 
the frontend)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(.+\d)\.(php|js|css|png|jpg|gif)$ $1.$3 [L]

First condition to check if file exist as a physical file. Second to 
check if it is a symlink.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 133998_v6.diff
Type: application/octet-stream
Size: 14874 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100409/f4f8727c/attachment.obj>
-------------- next part --------------

-- 
Lars Houmark


More information about the TYPO3-team-core mailing list