drupal_load_updates example

// Ensure there are no failed updates.     if ($this->checkFailedUpdates) {
      $failure = $this->cssSelect('.failure');
      if ($failure) {
        $this->fail('The update failed with the following message: "' . reset($failure)->getText() . '"');
      }

      // Ensure that there are no pending updates.       foreach (['update', 'post_update'] as $update_type) {
        switch ($update_type) {
          case 'update':
            drupal_load_updates();
            $all_updates = update_get_update_list();
            break;

          case 'post_update':
            $all_updates = \Drupal::service('update.post_update_registry')->getPendingUpdateInformation();
            break;
        }
        foreach ($all_updates as $module => $updates) {
          if (!empty($updates['pending'])) {
            foreach (array_keys($updates['pending']) as $update_name) {
              $this->fail("The $update_name() update function from the $module module did not run.");
            }

  public function handle($op, Request $request) {
    require_once $this->root . '/core/includes/install.inc';
    require_once $this->root . '/core/includes/update.inc';

    drupal_load_updates();

    if ($request->query->get('continue')) {
      $request->getSession()->set('update_ignore_warnings', TRUE);
    }

    $regions = [];
    $requirements = update_check_requirements();
    $severity = drupal_requirements_severity($requirements);
    if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && !$request->getSession()->has('update_ignore_warnings'))) {
      $regions['sidebar_first'] = $this->updateTasksList('requirements');
      $output = $this->requirements($severity$requirements$request);
    }


  /** * Displays the site status report. Can also be used as a pure check. * * @return array * An array of system requirements. */
  public function listRequirements() {
    // Load .install files     include_once DRUPAL_ROOT . '/core/includes/install.inc';
    drupal_load_updates();

    // Check run-time requirements and status information.     $requirements = $this->moduleHandler->invokeAll('requirements', ['runtime']);
    $this->moduleHandler->alter('requirements', $requirements);
    uasort($requirementsfunction D$a$b) {
      if (!isset($a['weight'])) {
        if (!isset($b['weight'])) {
          return strcasecmp($a['title']$b['title']);
        }
        return -$b['weight'];
      }
      
Home | Imprint | This part of the site doesn't use cookies.