Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Less_Cache should take options into account #350

Open
Svish opened this issue Aug 2, 2017 · 4 comments
Open

Less_Cache should take options into account #350

Svish opened this issue Aug 2, 2017 · 4 comments

Comments

@Svish
Copy link

Svish commented Aug 2, 2017

When I change options (like 'compress' => true / false), the Less_Cache::get doesn't seem to care and just reuses its cache. 😕

This is a bit annoying, especially for me who's trying to figure out how to use this thing. 😛

Would it be possible for the Less_Cache::get method to also take into account its given options when deciding if it needs to re-compile?

@Svish Svish changed the title Have Less_Cache take options into account Less_Cache should take options into account Aug 2, 2017
@kylekatarnls
Copy link

Hi, I consider this feature in my fork, could you try to require kylekatarnls/less.php instead of oyejorge/less.php and tell me if it works for you?

Thanks.

@Svish
Copy link
Author

Svish commented Aug 4, 2017

Replaced Cache.php with yours, and... doesn't seem to do anything for this?

Looking at the diff though, and your change looks to be inside an if (!empty($modify_vars)), and as I'm not modifying any vars at all, that probably explains why. Think the adjustment needs to be done somewhere else?

How I call the method:

File::mkdir(self::CACHE);
$this->_css = self::CACHE . Lessc::Get([ $this->_less => WEBROOT ],
	[
		'compress' => true,
		'strictMath' => true,
		'cache_dir' => self::CACHE,
		'indentation' => "\t",
		'import_callback' => [$this, 'find_import'],
	]);

Tested it by toggling compress on and off, and the output gets "stuck" on one until I either delete the cache (obviously) or touch one of the less files.

@kylekatarnls
Copy link

OK, understood the point. I will inspect that. You should be able to work-around this meanwhile by passing the compress value also in your less variables.

@kylekatarnls
Copy link

Sorry I broke something, now I enable TravisCI to avoid such regression, please try with this version: https://github.com/kylekatarnls/less.php/releases/tag/v1.7.0.17

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants