function Drupal::hasContainer

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

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

Return value

bool

10 calls to Drupal::hasContainer()
AccountProxyTest::testId in core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
@covers ::id @covers ::setInitialAccountId
DependencySerializationTrait::__wakeup in core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php
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.
drupal_get_profile in core/includes/bootstrap.inc
Gets the name of the currently active installation profile.

... See full list

File

core/lib/Drupal.php, line 140

Class

Drupal
Static Service Container wrapper.

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.