function ModuleUpdater::getSchemaUpdates

Return available database schema updates one a new version is installed.

File

modules/system/system.updater.inc, line 54

Class

ModuleUpdater
Class for updating modules using FileTransfer classes via authorize.php.

Code

public function getSchemaUpdates() {
  require_once DRUPAL_ROOT . '/includes/install.inc';
  require_once DRUPAL_ROOT . '/includes/update.inc';
  if (_update_get_project_type($project) != 'module') {
    return array();
  }
  module_load_include('install', $project);
  if (!($updates = drupal_get_schema_versions($project))) {
    return array();
  }
  $updates_to_run = array();
  $modules_with_updates = update_get_update_list();
  if ($updates = $modules_with_updates[$project]) {
    if ($updates['start']) {
      return $updates['pending'];
    }
  }
  return array();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.