Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UpdateKernel.php

function UpdateKernel::setupRequestMatch

Set up the request with fake routing data for update.php.

This fake routing data is needed in order to make batch API work properly.

Parameters

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

1 call to UpdateKernel::setupRequestMatch()
UpdateKernel::handleRaw in core/lib/Drupal/Core/Update/UpdateKernel.php
Generates the actual result of update.php.

File

core/lib/Drupal/Core/Update/UpdateKernel.php, line 153

Class

UpdateKernel
Defines a kernel which is used primarily to run the update of Drupal.

Namespace

Drupal\Core\Update

Code

protected function setupRequestMatch(Request $request) {
    $path = $request->getPathInfo();
    $args = explode('/', ltrim($path, '/'));
    $request->attributes
        ->set(RouteObjectInterface::ROUTE_NAME, 'system.db_update');
    $request->attributes
        ->set(RouteObjectInterface::ROUTE_OBJECT, $this->getContainer()
        ->get('router.route_provider')
        ->getRouteByName('system.db_update'));
    $op = $args[0] ?: 'info';
    $request->attributes
        ->set('op', $op);
    $request->attributes
        ->set('_raw_variables', new InputBag([
        'op' => $op,
    ]));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal