You are here

function _calendar_systems_patches_applied in Calendar Systems 6.2

Internal helper to check whether the required patches are currently applied.

Return value

TRUE if all required patches are applies, FALSE otherwise.

7 calls to _calendar_systems_patches_applied()
calendar_systems_calendars_form in ./calendar_systems.admin.inc
Form callback to list all available calendars and their config links.
calendar_systems_enable in ./calendar_systems.install
Implements hook_enable().
calendar_systems_install in ./calendar_systems.install
Implements hook_install().
calendar_systems_uninstall in ./calendar_systems.install
Implements hook_uninstall().
theme_calendar_systems_calendars_form in ./calendar_systems.admin.inc
Theme callback for calendars listing form.

... See full list

File

./calendar_systems.patch.inc, line 81
A collection of internal helpers around the compatibility patches.

Code

function _calendar_systems_patches_applied() {

  // Get required patch arrays.
  $patches = _calendar_systems_patches(TRUE);
  foreach ($patches as $identifier => $patch) {

    // Findout patch target absolute path.
    // $patch['target'] should have its relative path in.
    $target = function_exists('absolute_path') ? absolute_path() . '/' . $patch['target'] : realpath(drupal_get_path('module', 'system') . '/../../' . $patch['target']);

    // Applied?
    if (strpos(file_get_contents($target), $patch['fingerprint']) === FALSE) {
      return FALSE;
    }
  }
  return TRUE;
}