ndeet / plg_system_less

A Joomla! system plugin to compile .less files on the fly.
GNU Lesser General Public License v3.0
17 stars 13 forks source link

When moving site - plugin tries to find files using old path #9

Closed penance closed 11 years ago

penance commented 11 years ago

Not sure if this is an issue with the plugin or not. I have this quick start installation i made on my local server. When uploading it to a new test site (live on Linux, currently available on bigberta.com) - the compiler remembers the old windows path to the files - and produces this error on top of the page:

lessphp error: load error: failed to find D:\wamp\www\Vcore\templates/vcoretemplate\less/template.less

--> it is looking for the old windows path.

I have not found any recors of this in the database info for the plugin, or anywehre else.

penance commented 11 years ago

I have found a way to fix the problem. I deleted the files from the TEMP folder. it fixed the problem. I'm just a PHP novice, but there must be some little snippet to add to fix a problem like this. This should hurt any time a person moves the site from dev environment to a server, or from server to server. I would also like to thank you guys for the awesome work!

ndeet commented 11 years ago

Hi penance,

thank you for your issue report. I had a look on the issue. The lessphp library used by the plugin does store the full absolute path into cache files (located in /tmp/ ) - as you found out already. So after moving the site the old path are still in those cache files and the compiler fails. The cleanest solution would be if lessphp fixes the paths but maybe I can fix it faster for the plugin - I will have a deeper look.

Thank you.

penance commented 11 years ago

Thank you for the reply, and this awesome plugin. For now I'll clear the temp. Will be happy if you could update me if you solve this so I can update, as your plugin is core extension for me for all my new installs.

A simple solution could be just to compare the absolute path in the tmp with the current path - and if it has changed, delete the temp. I am no expert, but this doesn't seem like a big performance issue and will solve the problem.

ndeet commented 11 years ago

Hi penance,

yep, that's what came into my mind too first. Now there is a path check inside. Would be great if you could test the current version and report back if it works now. You can download the latest version here https://github.com/ndeet/plg_system_less/archive/master.zip