You are here

function fullcalendar_get_version in FullCalendar 8

Same name and namespace in other branches
  1. 8.5 fullcalendar.module \fullcalendar_get_version()
  2. 8.2 fullcalendar.module \fullcalendar_get_version()
  3. 8.3 fullcalendar.module \fullcalendar_get_version()
  4. 8.4 fullcalendar.module \fullcalendar_get_version()
  5. 6.2 fullcalendar.module \fullcalendar_get_version()
  6. 6 fullcalendar.module \fullcalendar_get_version()
  7. 7.2 fullcalendar.module \fullcalendar_get_version()
  8. 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

version_compare()

1 call to fullcalendar_get_version()
fullcalendar_requirements in ./fullcalendar.install
Implements hook_requirements().

File

./fullcalendar.module, line 170
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 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;
}