foreach ($all_messages as $type =>
$messages) { foreach ($messages as $message) { $this->container->
get('messenger'
)->
addMessage($message,
$type);
} } \Drupal::
setContainer($this->container
);
// Allow other parts of the codebase to react on container initialization in
// subrequest.
if (!
empty($subrequest)) { $this->container->
get('event_dispatcher'
)->
dispatch(new Event(), self::CONTAINER_INITIALIZE_SUBREQUEST_FINISHED
);
} // If needs dumping flag was set, dump the container.
if ($this->containerNeedsDumping && !
$this->
cacheDrupalContainer($container_definition)) { $this->container->
get('logger.factory'
)->
get('DrupalKernel'
)->
error('Container cannot be saved to cache.'
);
} return $this->container;
} /**
* Setup a consistent PHP environment.
*
* This method sets PHP environment options we want to be sure are set
* correctly for security or just saneness.
*
* @param string $app_root
* (optional) The path to the application root as a string. If not supplied,
* the application root will be computed.
*/