jalmenarez / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Separate controller logic from Minify #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify could use an abstract controller class that maps URLs to an array 
of file paths to be combined. 

This way the user could chose other ways to specify sets of files, like 
pre-defined groups, or by specifying particular directories that can be 
used, particular patterns that the file names must match, custom formats 
for the URLs (avoiding the need for mod_rewrite), etc. In this way, all 
the path resolution code could be moved to only controllers that need it.

URLs could be like:
/minify.php/js/jQuery,plugin.jQuery,myScript
or just
/minify.php/homePageJs

A problem with the current system is that the visitor has the ability to 
specify long sets of files in different orders that are of no use to the 
site, yet PHP still has to act on these requests, resolve paths, check 
file existence, combine, minimize, cache and serve these bogus files. Not 
exactly a DoS issue, I know.

With that in mind, I'd suggest that the default controller should force 
the user to define keys to groups of files that need combining. Or at 
least force the user to define allowable directories for certain types. In 
any case being able to eliminate relative path resolution would be great 
for security.

Original issue reported on code.google.com by stephen....@gmail.com on 21 Sep 2007 at 4:34

GoogleCodeExporter commented 9 years ago
This is an excellent idea. Thanks.

Original comment by rgr...@gmail.com on 21 Sep 2007 at 5:21

GoogleCodeExporter commented 9 years ago
In trunk!

Original comment by mrclay....@gmail.com on 29 Feb 2008 at 2:06