function Drupal::setContainer
Sets a new global container.
Parameters
\Symfony\Component\DependencyInjection\ContainerInterface $container: A new container instance to replace the current.
4 calls to Drupal::setContainer()
- DrupalKernel::initializeContainer in core/
lib/ Drupal/ Core/ DrupalKernel.php - Initializes the service container.
- FunctionalTestSetupTrait::getDatabaseTypes in core/
lib/ Drupal/ Core/ Test/ FunctionalTestSetupTrait.php - Returns all supported database driver installer objects.
- install_begin_request in core/
includes/ install.core.inc - Begins an installation request, modifying the installation state as needed.
- TestKernel::setContainerWithKernel in core/
lib/ Drupal/ Core/ Test/ TestKernel.php - Sets a container with a kernel service on the Drupal class.
File
-
core/
lib/ Drupal.php, line 149
Class
- Drupal
- Static Service Container wrapper.
Code
public static function setContainer(ContainerInterface $container) {
static::$container = $container;
}