You are here

function _photobox_library_version in PhotoboxPhotobox 7

Returns version of the Photobox library.

2 calls to _photobox_library_version()
photobox_library in ./photobox.module
Implements hook_library().
photobox_requirements in ./photobox.install
Implements hook_requirements().

File

./photobox.module, line 380
Main file for the Photobox module.

Code

function _photobox_library_version() {
  $version =& drupal_static(__FUNCTION__, NULL);
  if (is_null($version) && ($library_path = _photobox_library_path())) {
    $pattern = '/photobox v([0-9\\.a-z]+)/';
    $photobox_js = file_get_contents(_photobox_library_path_js(), NULL, NULL, 0, 32);
    if (preg_match($pattern, $photobox_js, $matches)) {
      $version = $matches[1];
    }
    else {
      $version = 'Unknown';
    }
  }
  return $version;
}