Commit 02fec435 authored by katbailey's avatar katbailey
Browse files

Fixing up drupal_container() which had some cruft leftover in it and a totally incorrect docblock

parent e1b4fe97
...@@ -2407,25 +2407,20 @@ function drupal_get_bootstrap_phase() { ...@@ -2407,25 +2407,20 @@ function drupal_get_bootstrap_phase() {
/** /**
* Retrieves the Drupal Container to standardize object construction. * Retrieves the Drupal Container to standardize object construction.
* *
* Example: * On a normal page request the container is built by the kernel and passed in
* @code * to this function which stores it statically. Any full bootstrap outside of
* // Register the LANGUAGE_TYPE_INTERFACE definition. Registered definitions * the context of a page request will require a container with a minimal set of
* // do not necessarily need to be named by a constant. * services. If this function is called without the $reset parameter, and no
* // See * container object has been statically cached, it builds this minimal container,
* // http://symfony.com/doc/current/components/dependency_injection/introduction.html * registering the services that are required.
* // for usage examples of adding object initialization code after register(). *
* $container = drupal_container(); * @see Drupal\Core\DrupalKernel
* $container->register(LANGUAGE_TYPE_INTERFACE, 'Drupal\\Core\\Language\\Language');
*
* // Retrieve the LANGUAGE_TYPE_INTERFACE object.
* $language_interface = language_manager(LANGUAGE_TYPE_INTERFACE);
* @endcode
* *
* @param $reset * @param $reset
* A new container instance to reset the Drupal container to. * A new container instance to reset the Drupal container to.
* *
* @return Drupal\Component\DependencyInjection\ContainerBuilder * @return Symfony\Component\DependencyInjection\Container
* The instance of the Drupal Container used to set up and maintain object * The instance of the Container used to set up and maintain object
* instances. * instances.
*/ */
function drupal_container(Container $reset = NULL) { function drupal_container(Container $reset = NULL) {
...@@ -2442,9 +2437,6 @@ function drupal_container(Container $reset = NULL) { ...@@ -2442,9 +2437,6 @@ function drupal_container(Container $reset = NULL) {
// This will get merged with the full Kernel-built Container on normal page // This will get merged with the full Kernel-built Container on normal page
// requests. // requests.
$container = new ContainerBuilder(); $container = new ContainerBuilder();
// An interface language always needs to be available for t() and other
// functions.
$container->register(LANGUAGE_TYPE_INTERFACE, 'Drupal\\Core\\Language\\Language');
// Register configuration storage dispatcher. // Register configuration storage dispatcher.
$container->setParameter('config.storage.info', array( $container->setParameter('config.storage.info', array(
'Drupal\Core\Config\DatabaseStorage' => array( 'Drupal\Core\Config\DatabaseStorage' => array(
......
...@@ -58,6 +58,7 @@ protected function initializeContainer() { ...@@ -58,6 +58,7 @@ protected function initializeContainer() {
protected function buildContainer() { protected function buildContainer() {
$container = $this->getContainerBuilder(); $container = $this->getContainerBuilder();
// Merge in the minimal bootstrap container.
if ($bootstrap_container = drupal_container()) { if ($bootstrap_container = drupal_container()) {
$container->merge($bootstrap_container); $container->merge($bootstrap_container);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment