You are here

function fullcalendar_get_version in FullCalendar 7

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

Returns the version of FullCalender plugin that is installed.

This can be used by other modules' hook_requirements() to ensure that the proper version of Colorbox plugin is installed.

See also

version_compare

2 calls to fullcalendar_get_version()
fullcalendar_requirements in ./fullcalendar.install
Implements of hook_requirements().
_fullcalendar_status in ./fullcalendar.module
Checks FullCalendar dependencies.

File

./fullcalendar.module, line 424
Provides a views style plugin for FullCalendar

Code

function fullcalendar_get_version($fullcalendar_path = NULL) {
  $version = 0;
  $pattern = '#FullCalendar v([0-9\\.a-z]+)#';

  // No file is passed in so use the default location.
  if (is_null($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;
}