Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::hasContainer()
  2. 9 core/lib/Drupal.php \Drupal::hasContainer()

Returns TRUE if the container has been initialized, FALSE otherwise.

Return value

bool

8 calls to Drupal::hasContainer()
AccountProxyTest::testId in core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
@covers ::id @covers ::setInitialAccountId
Database::getDriverList in core/lib/Drupal/Core/Database/Database.php
Returns the list provider for available database drivers.
Drupal::hasRequest in core/lib/Drupal.php
Indicates if there is a currently active request object.
Drupal::hasService in core/lib/Drupal.php
Indicates if a service is defined in the container.
ExtensionDiscovery::setProfileDirectoriesFromSettings in core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
Sets installation profile directories based on current site settings.

... See full list

File

core/lib/Drupal.php, line 179

Class

Drupal
Static Service Container wrapper.

Code

public static function hasContainer() {
  return static::$container !== NULL;
}