You are here

function _soundmanager2_get_version in SoundManager2 7.2

Same name and namespace in other branches
  1. 6.2 soundmanager2.module \_soundmanager2_get_version()

Get the version of the SoundManager 2

1 call to _soundmanager2_get_version()
soundmanager2_requirements in ./soundmanager2.install
Implements hook_requirements().

File

./soundmanager2.module, line 671
Responsible for managing the required SWF and JS files for soundmanager2 to work

Code

function _soundmanager2_get_version($sm2_script = 'sites/all/libraries/soundmanager2/script/soundmanager2.js') {
  $version_str = '';
  if (file_exists($sm2_script)) {
    $lines = file($sm2_script);
    foreach ($lines as $line) {
      if (preg_match('/V(.*)$/', $line)) {
        $version_str = check_plain(preg_replace('/^(.*) /i', '', $line));
        break;
      }
    }
  }
  return $version_str;
}