richthegeek / phpsass

A compiler for SASS/SCSS written in PHP, brought up to date (approx 3.2) from a fork of PHamlP: http://code.google.com/p/phamlp/
http://phpsass.com/
382 stars 83 forks source link

URLs fail to correctly format when symlinked #172

Open ChrisHughes opened 10 years ago

ChrisHughes commented 10 years ago

Using realpath in the get_file and find_file functions means that compass's font-url, image-url, etc all fail because it relies on first finding the file as a filesystem path, then doing a string substitution for the current DOCUMENT_ROOT. This fails when symlinking code into the web folder from, say, a project directory outside the current web root.

We use a similar setup for rails and rails's compass does not do this - it works as expected.

I believe the issue is the reliance on realpath which removes symlinks, where symlinks should ideally be preserved.

Another issue I'd love to see fixed is providing an option when initializing the SassParser to output external urls, containing the current domain name. When hosting compiled assets on a CDN, this causes all font / image urls to fail, as they are relative to the current host which is the CDN, but were compiled on a separate server with a separate hostname.