public static function Drupal::getContainer

Returns the currently active global container.

Return value

\Symfony\Component\DependencyInjection\ContainerInterface

Deprecated

This method is only useful for the testing environment, and as a BC shiv for drupal_container(). It should not be used otherwise.

6 calls to Drupal::getContainer()
Cache::getBins in drupal/core/lib/Drupal/Core/Cache/Cache.php
Gets all cache bin services.
ContainerFactory::createInstance in drupal/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php
Implements Drupal\Component\Plugin\Factory\FactoryInterface::createInstance().
drupal_container in drupal/core/includes/bootstrap.inc
Retrieves the Drupal Container to standardize object construction.
drupal_mkdir in drupal/core/includes/file.inc
Creates a directory, optionally creating missing components in the path to the directory.
st in drupal/core/includes/install.inc
Translates a string when some systems are not available.

... See full list

File

drupal/core/lib/Drupal.php, line 104
Contains Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function getContainer() {
  return static::$container;
}