You are here

public static function Lessjs::version in Less CSS Preprocessor 7.4

Same name and namespace in other branches
  1. 8 classes/class.lessjs.inc \Lessjs::version()
  2. 7.3 class.lessjs.inc \Lessjs::version()

Returns the version string from command line less.js.

Return value

string|null Version string from less.js, or null if no version found.

File

classes/class.lessjs.inc, line 79
Contains 'lessjs' class; an abstraction layer for command line less.js.

Class

Lessjs
'lessjs' class.

Code

public static function version() {
  $version = NULL;
  if (function_exists('proc_open')) {
    try {
      $version_response = self::create(NULL)
        ->proc_open(array(
        '--version',
      ));
      $version = preg_replace('/.*?([\\d\\.]+).*/', '$1', $version_response);
    } catch (Exception $e) {
    }
  }
  return $version;
}