leafo/lessphp — pull request #162 by sanchothefat (2011-12-15 02:25:36+00:00)
Title: Passing php vars into ccompile and cexecute

Hello Mr Leafo,

At least one bit of this request would be good to have - I can understand if you wish to keep ccompile simple.

I've added a means of passing variables into cexecute and comparing the cache against the passed in vars to make it recompile if they change.

With ccompile I've added a $vars parameter and also a force parameter so that developers can decide for themselves using their own database or cache of the variables to decide if the file needs recompiling.

Passing the variables in is especially useful for me as it allows me to pass in data from the cms to use within .less files. I have a wordpress based auto compiler that I want to use it with at https://github.com/sanchothefat/wp-less

Using the methods is much more straightforward than rolling my own caching mechanism.

Let me know what you think and any changes you'd like me to make if you do want to pull the changes.