jalmenarez / minify

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

Support for symlinks #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify is a great tool, and it severed all of my needs, until I found out it 
didn't work with symlinks.
For the moment I have gone around the problem by extending the Minify class 
with my own, 
overridding the methods that causes issues, because I don't want to modify the 
Minify code if that 
is a feature that will be left out on a new update.

Afaik, there isn't any reason to why symlinks shouldn't be allowed, as they can 
be used directly from 
the webserver. If you need help fixing it, just let meg know, I'd be happy to 
help out on the issue.

Original issue reported on code.google.com by e...@hpuls.no on 26 Jan 2008 at 11:09

GoogleCodeExporter commented 9 years ago
Can you give a concrete example of what you're trying to do?

Original comment by mrclay....@gmail.com on 28 Feb 2008 at 12:52

GoogleCodeExporter commented 9 years ago

Original comment by mrclay....@gmail.com on 14 May 2008 at 4:25

GoogleCodeExporter commented 9 years ago
If you have a directory structure like this:

/var/www/shared/js/myjspackage1.js
/var/www/shared/js/myjspackage2.js
/var/www/example.com/html/js/myjspackage1.js => symlink to: 
/var/www/shared/js/myjspackage1.js
/var/www/otherexample.com/html/js/myjspackage1.js => symlink to: 
/var/www/shared/js/myjspackage1.js

Minify won't handle the files in example.com and otherexample.com since they 
are symbolic links (and it finds 
that the realpath is not in the allowed path domain or something).

Original comment by grEv...@gmail.com on 14 May 2008 at 5:20

GoogleCodeExporter commented 9 years ago
The Groups or Files controllers with Minify 2 should be able to accept symlinks 
as
long as PHP can open the target files. They do not require that the file's 
realpath()
be inside $_SERVER['DOCUMENT_ROOT'].

Original comment by mrclay....@gmail.com on 1 Jun 2008 at 3:53

GoogleCodeExporter commented 9 years ago
Minify 2.1 would not work when my entire DOCUMENT_ROOT is symlinked to (running 
PHP 5.2.6 on OS X 
Leopard). The fix was to change this line 285 in version 2.1 of 
lib/Minify/CSS.php from:

$path = substr($path, strlen($_SERVER['DOCUMENT_ROOT']));

to:

$path = substr($path, strlen(realpath($_SERVER['DOCUMENT_ROOT'])));

Hope this prevents hours of frustration for someone else.

Original comment by pvulga...@gmail.com on 7 Oct 2008 at 11:21

GoogleCodeExporter commented 9 years ago
@pvulgaris: Thanks for your help debugging this. I just committed R254 making 
sure 
all doc root accesses are passed through realpath.

Original comment by mrclay....@gmail.com on 8 Oct 2008 at 1:23