Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
02fec435
Commit
02fec435
authored
Jul 26, 2012
by
Katherine Bailey
Browse files
Fixing up drupal_container() which had some cruft leftover in it and a totally incorrect docblock
parent
e1b4fe97
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/includes/bootstrap.inc
View file @
02fec435
...
...
@@ -2407,25 +2407,20 @@ function drupal_get_bootstrap_phase() {
/**
* Retrieves the Drupal Container to standardize object construction.
*
* Example:
* @code
* // Register the LANGUAGE_TYPE_INTERFACE definition. Registered definitions
* // do not necessarily need to be named by a constant.
* // See
* // http://symfony.com/doc/current/components/dependency_injection/introduction.html
* // for usage examples of adding object initialization code after register().
* $container = drupal_container();
* $container->register(LANGUAGE_TYPE_INTERFACE, 'Drupal\\Core\\Language\\Language');
*
* // Retrieve the LANGUAGE_TYPE_INTERFACE object.
* $language_interface = language_manager(LANGUAGE_TYPE_INTERFACE);
* @endcode
* On a normal page request the container is built by the kernel and passed in
* to this function which stores it statically. Any full bootstrap outside of
* the context of a page request will require a container with a minimal set of
* services. If this function is called without the $reset parameter, and no
* container object has been statically cached, it builds this minimal container,
* registering the services that are required.
*
* @see Drupal\Core\DrupalKernel
*
* @param $reset
* A new container instance to reset the Drupal container to.
*
* @return
Drupal
\Component\DependencyInjection\Container
Builder
* The instance of the
Drupal
Container used to set up and maintain object
* @return
Symfony
\Component\DependencyInjection\Container
* The instance of the Container used to set up and maintain object
* instances.
*/
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
// requests.
$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.
$container
->
setParameter
(
'config.storage.info'
,
array
(
'Drupal\Core\Config\DatabaseStorage'
=>
array
(
...
...
core/lib/Drupal/Core/DrupalKernel.php
View file @
02fec435
...
...
@@ -58,6 +58,7 @@ protected function initializeContainer() {
protected
function
buildContainer
()
{
$container
=
$this
->
getContainerBuilder
();
// Merge in the minimal bootstrap container.
if
(
$bootstrap_container
=
drupal_container
())
{
$container
->
merge
(
$bootstrap_container
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment