You are here

function elfinder_get_installed_version in elFinder file manager 7.3

Return the elfinder js library version #.

Return value

  • string version #
  • 'unknown' if unable to detect version
  • FALSE if file could not be read
1 call to elfinder_get_installed_version()
elfinder_requirements in ./elfinder.install
Implements hook_requirements().

File

./elfinder.module, line 1172

Code

function elfinder_get_installed_version() {
  if (module_exists('libraries')) {
    $library = libraries_detect('elfinder');
    return $library['installed'] ? $library['version'] : FALSE;
  }
  else {
    $js_file = elfinder_lib_path() . '/js/elfinder.min.js';
    $js_contents = @file_get_contents($js_file);
    if (!$js_contents) {
      return FALSE;
    }
    if (preg_match('@ \\* Version\\s+([0-9\\.]+)@', $js_contents, $matches)) {
      return $matches[1];
    }
    return 'unknown';
  }
}