oyejorge / less.php

less.js ported to PHP.
http://lessphp.typesettercms.com
Apache License 2.0
657 stars 2 forks source link

Caching not well documented #65

Open dleffler opened 10 years ago

dleffler commented 10 years ago

I need to develop an auto-compile routine in php and the less.php caching documentation seems a little unclear...e.g., what/why the difference in caching css and parser? e.g., should be able to pass a pathname and get a new compilation or pull out of the cache?

oyejorge commented 10 years ago

what/why the difference in caching css and parser?

Here's what I want to tell you:

[parser caching] only caches intermediate parsing results to improve the performance of repeated css generation

But that's directly from the readme file. Maybe I'm not understanding your question?

should be able to pass a pathname and get a new compilation or pull out of the cache?

That's pretty much what Less_Cache::Get() does.

govza commented 10 years ago

Can't understand how to clean the cache?

oyejorge commented 10 years ago

It's not documented is it..

Less_Cache::$cache_dir = '/var/www/writable_folder';
Less_Cache::CleanCache();

This function is available and will remove lessphp_* files (i.e. files created by less.php) from the cache directory if they're at least 7 days old. It is called automatically if new files are created.

I'm thinking adding the ability to pass options to this function would be helpful.

dleffler commented 10 years ago

Perhaps (in my case) it would've been worthy to note the use of less.inc.php as a QUICK transition from leafo lessphp since it's not documented in the readme?