update_check_incompatibility

Versions
6 – 7
update_check_incompatibility($name, $type = 'module')

Helper function to test compatibility of a module or theme.

▾ 2 functions call update_check_incompatibility()

update_fix_compatibility in includes/update.inc
Disable anything in the {system} table that is not compatible with the current version of Drupal core.
update_get_update_list in includes/update.inc
Return a list of all the pending database updates.

Code

includes/update.inc, line 34

<?php
function update_check_incompatibility($name, $type = 'module') {
  static $themes, $modules;

  // Store values of expensive functions for future use.
  if (empty($themes) || empty($modules)) {
    $themes = _system_rebuild_theme_data();
    $modules = system_rebuild_module_data();
  }

  if ($type == 'module' && isset($modules[$name])) {
    $file = $modules[$name];
  }
  elseif ($type == 'theme' && isset($themes[$name])) {
    $file = $themes[$name];
  }
  if (!isset($file)
      || !isset($file->info['core'])
      || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY
      || version_compare(phpversion(), $file->info['php']) < 0
      || ($type == 'module' && empty($file->info['files']))) {
    return TRUE;
  }
  return FALSE;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.