Change record status: 
Project: 
Introduced in branch: 
12.1.x
Introduced in version: 
12.1.0
Description: 

The dr console application can boot a custom kernel
\Drupal\Core\Command\DrupalApplication now accepts a kernel.class context value to select the kernel it boots. This lets code that creates the dr console application use a specialized kernel, such as UpdateKernel, instead of DrupalKernel.

Pass the class name in the application's context array:

use Drupal\Core\Command\DrupalApplication;
use Drupal\Core\Update\UpdateKernel;

$application = new DrupalApplication($classloader, [
  'kernel.class' => UpdateKernel::class,
] + $context);

The class must be DrupalKernel or a subclass; an invalid value causes an \InvalidArgumentException during bootstrap.

Generated with the help of an LLM.

Impacts: 
Module developers