function _calendar_systems_install_patch_applied in Calendar Systems 7.3
Internal helper to check whether the required patch is applied or not.
Return value
Boolean value.
1 call to _calendar_systems_install_patch_applied()
- calendar_systems_requirements in ./
calendar_systems.install - Implements hook_requirements().
File
- ./
calendar_systems.install, line 85 - Contains Calendar Systems installation hooks.
Code
function _calendar_systems_install_patch_applied() {
$content = file_get_contents(DRUPAL_ROOT . '/includes/common.inc');
// Check against patch fingerprint:
$patch_applied = strpos($content, 'foreach (module_implements(\'format_date\') AS $module) {') !== FALSE ? TRUE : FALSE;
$new_patch_applied = strpos($content, 'foreach (module_implements(\'format_date_calendar_systems\') AS $module) {') !== FALSE ? TRUE : FALSE;
if (!$new_patch_applied && $patch_applied) {
return 'outdated';
}
if ($new_patch_applied) {
return TRUE;
}
return $patch_applied;
}