You are here

function jqmulti_jquery_version_from_path in jQuery Multi 7

Same name and namespace in other branches
  1. 6 jqmulti.module \jqmulti_jquery_version_from_path()

Gets the jQuery version from the properly formatted filename.

Parameters

$path the full path to the jQuery library file:

2 calls to jqmulti_jquery_version_from_path()
jqmulti_get_version in ./jqmulti.module
Gets the version of jQuery to load.
jqmulti_get_version in ./jqmulti.api.php
Gets the version of jQuery to load.

File

./jqmulti.module, line 247
Code for the jQuery Multi module.

Code

function jqmulti_jquery_version_from_path($path) {
  $parts = explode('/', $path);
  $filename = array_pop($parts);
  $matches = array();
  preg_match('/jquery-(.*)\\.min\\.js/', $filename, $matches);
  if (count($matches) == 2) {
    return $matches[1];
  }
  else {
    return FALSE;
  }
}