function fullcalendar_get_version in FullCalendar 8.4
Same name and namespace in other branches
- 8.5 fullcalendar.module \fullcalendar_get_version()
 - 8 fullcalendar.module \fullcalendar_get_version()
 - 8.2 fullcalendar.module \fullcalendar_get_version()
 - 8.3 fullcalendar.module \fullcalendar_get_version()
 - 6.2 fullcalendar.module \fullcalendar_get_version()
 - 6 fullcalendar.module \fullcalendar_get_version()
 - 7.2 fullcalendar.module \fullcalendar_get_version()
 - 7 fullcalendar.module \fullcalendar_get_version()
 
Returns the version of FullCalendar plugin that is installed.
This can be used by other modules' hook_requirements() to ensure that the proper version of FullCalendar plugin is installed.
See also
1 call to fullcalendar_get_version()
- fullcalendar_requirements in ./
fullcalendar.install  - Implements hook_requirements().
 
File
- ./
fullcalendar.module, line 147  - Provides a views style plugin for FullCalendar
 
Code
function fullcalendar_get_version($fullcalendar_path = NULL) {
  $version =& drupal_static(__FUNCTION__);
  if (empty($version)) {
    $version = 0;
    $pattern = '#FullCalendar Core Package v([0-9\\.a-z]+)#';
    // No file is passed in so use the default location.
    if (!$fullcalendar_path) {
      $fullcalendar_path = fullcalendar_get_js_path();
    }
    // Return the version of FullCalendar plugin.
    $fullcalendar_plugin = file_get_contents($fullcalendar_path, NULL, NULL, 0, 40);
    if (preg_match($pattern, $fullcalendar_plugin, $matches)) {
      $version = $matches[1];
    }
  }
  return $version;
}