I think it would be nice if the module can report the lessphp version number it's using. That will allow developers to look up which less functions can be used and check if the libraries module is loading the library correctly. The status report screen would be a good place, I guess.

Once you have the lessphp include path (just like _less_pre_render() does) you can use this code to get the version string:

  preg_match('#lessphp v[0-9\.]+#', file_get_contents($lessphp_include, NULL, NULL, 0, 200), $matches);
  $version_string = $matches[0];
  // $version_string is now "lessphp v0.3.1"

If you think this feature is worth implementing, I can try to create a real patch (or feel free to implement it yourself if you like :-)).

Comments

marcvangend’s picture

Title: Report lessphp verion number » Report lessphp version number
corey.aufang’s picture

This is already in the works :)

marcvangend’s picture

Status: Active » Needs work

Awesome, thanks Corey. I'll just set this to 'need work' then, even though the work is not visible here. Let me know if I can help.

portulaca’s picture

+1

attiks’s picture

I needed this as well, so I've opened an issue at https://github.com/leafo/lessphp/issues/186

marcvangend’s picture

Yes, that would be much nicer than my quick-and-dirty regex.

marcvangend’s picture

The issue on github is now fixed and closed; upcoming versions will support a property: lessc::$VERSION.

markus_petrux’s picture

Would it be possible to use REQUIREMENT_OK instead of REQUIREMENT_WARNING for the entry $requirements['less_version'] in hook_requirements?

corey.aufang’s picture

If you're talking about the latest commit that I made, thanks for spotting that.

corey.aufang’s picture

Status: Needs work » Fixed

This should be resolved in 7.x-2.5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit ffb6c1d on 7.x-2.x, 7.x-3.x, 7.x-4.x:
    Issue #1246308 by corey.aufang, pillarsdotnet: Change directory to...