DbUpdateController::info

protected DbUpdateController::info(Request $request)

Returns the info database update page.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

Return value

array A render array.

File

core/modules/system/src/Controller/DbUpdateController.php, line 208

Class

DbUpdateController
Controller routines for database update routes.

Namespace

Drupal\system\Controller

Code

protected function info(Request $request) {
  // Change query-strings on css/js files to enforce reload for all users.
  _drupal_flush_css_js();
  // Flush the cache of all data for the update status module.
  $this->keyValueExpirableFactory->get('update')->deleteAll();
  $this->keyValueExpirableFactory->get('update_available_release')->deleteAll();

  $build['info_header'] = array(
    '#markup' => '<p>' . $this->t('Use this utility to update your database whenever a new release of Drupal or a module is installed.') . '</p><p>' . $this->t('For more detailed information, see the <a href="https://www.drupal.org/upgrade">upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.') . '</p>',
  );

  $info[] = $this->t("<strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.");
  $info[] = $this->t('Put your site into <a href=":url">maintenance mode</a>.', array(
    ':url' => Url::fromRoute('system.site_maintenance_mode')->toString(TRUE)->getGeneratedUrl(),
  ));
  $info[] = $this->t('<strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.');
  $info[] = $this->t('Install your new files in the appropriate location, as described in the handbook.');
  $build['info'] = array(
    '#theme' => 'item_list',
    '#list_type' => 'ol',
    '#items' => $info,
  );
  $build['info_footer'] = array(
    '#markup' => '<p>' . $this->t('When you have performed the steps above, you may proceed.') . '</p>',
  );

  $build['link'] = array(
    '#type' => 'link',
    '#title' => $this->t('Continue'),
    '#attributes' => array('class' => array('button', 'button--primary')),
    // @todo Revisit once https://www.drupal.org/node/2548095 is in.
    '#url' => Url::fromUri('base://selection'),
  );
  return $build;
}
doc_Drupal
2016-10-29 09:01:24
Comments
Leave a Comment

Please login to continue.