Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d1e52e00
Commit
d1e52e00
authored
Jul 23, 2012
by
katbailey
Browse files
Various cleanups
parent
f8e189ed
Changes
9
Hide whitespace changes
Inline
Side-by-side
core/includes/bootstrap.inc
View file @
d1e52e00
...
...
@@ -6,7 +6,6 @@
use
Symfony\Component\ClassLoader\ApcUniversalClassLoader
;
use
Symfony\Component\DependencyInjection\Container
;
use
Symfony\Component\DependencyInjection\ContainerBuilder
;
use
Symfony\Component\DependencyInjection\Definition
;
use
Symfony\Component\DependencyInjection\Reference
;
use
Symfony\Component\HttpFoundation\Request
;
use
Drupal\Core\Language\Language
;
...
...
core/includes/install.core.inc
View file @
d1e52e00
...
...
@@ -275,7 +275,7 @@ function install_begin_request(&$install_state) {
include_once
DRUPAL_ROOT
.
'/core/includes/session.inc'
;
// Set up $language, so t() caller functions will still work.
//
drupal_language_initialize();
drupal_language_initialize
();
require_once
DRUPAL_ROOT
.
'/core/includes/ajax.inc'
;
// Override the module list with a minimal set of modules.
...
...
core/includes/update.inc
View file @
d1e52e00
...
...
@@ -247,23 +247,16 @@ function update_prepare_d8_language() {
// Update the 'language_default' system variable, if configured.
$language_default
=
variable_get
(
'language_default'
);
if
(
!
empty
(
$language_default
)
&&
isset
(
$language_default
->
language
))
{
$language_default
->
langcode
=
$language_default
->
language
;
if
(
!
empty
(
$language_default
)
&&
(
isset
(
$language_default
->
langcode
)
||
isset
(
$language_default
->
language
)))
{
if
(
!
isset
(
$language_default
->
langcode
))
{
$language_default
->
langcode
=
$language_default
->
language
;
}
unset
(
$language_default
->
language
);
// In D8, the 'language_default' is not anymore an object, but an array,
// so make sure that the new value that is saved into this variable is an
// array.
variable_set
(
'language_default'
,
(
array
)
$language_default
);
}
else
{
variable_set
(
'language_default'
,
array
(
'langcode'
=>
'en'
,
'name'
=>
'English'
,
'direction'
=>
0
,
'weight'
=>
0
,
'locked'
=>
0
,
));
}
// Adds the locked column and saves the special languages.
if
(
!
db_field_exists
(
'language'
,
'locked'
))
{
...
...
core/lib/Drupal/Core/CoreBundle.php
View file @
d1e52e00
...
...
@@ -19,6 +19,7 @@ class CoreBundle extends Bundle
{
public
function
build
(
ContainerBuilder
$container
)
{
// Add a 'request' scope for services that depend on the Request object.
$container
->
addScope
(
new
Scope
(
'request'
));
$container
->
register
(
'dispatcher'
,
'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher'
)
...
...
core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php
View file @
d1e52e00
...
...
@@ -30,10 +30,6 @@ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig:
public
function
compile
()
{
$this
->
compiler
->
compile
(
$this
);
$this
->
parameterBag
->
resolve
();
// TODO: The line below is commented out because there is code that calls
// the set() method on the container after it has been built - that method
// throws an exception if the container's parameters have been frozen.
//$this->parameterBag = new FrozenParameterBag($this->parameterBag->all());
}
}
core/lib/Drupal/Core/DrupalKernel.php
View file @
d1e52e00
...
...
@@ -28,7 +28,8 @@ public function registerBundles() {
$modules
=
array_keys
(
system_list
(
'module_enabled'
));
foreach
(
$modules
as
$module
)
{
$class
=
"\Drupal
\\
{
$module
}
\\
{
$module
}
Bundle"
;
$camelized
=
ContainerBuilder
::
camelize
(
$module
);
$class
=
"\Drupal
\\
{
$module
}
\\
{
$camelized
}
Bundle"
;
if
(
class_exists
(
$class
))
{
$bundles
[]
=
new
$class
();
}
...
...
@@ -41,6 +42,9 @@ public function registerBundles() {
* Initializes the service container.
*/
protected
function
initializeContainer
()
{
// @todo We should be compiling the container and dumping to php so we don't
// have to recompile every time. There is a separate issue for this, see
// http://drupal.org/node/1668892.
$this
->
container
=
$this
->
buildContainer
();
$this
->
container
->
set
(
'kernel'
,
$this
);
drupal_container
(
$this
->
container
);
...
...
@@ -73,10 +77,14 @@ protected function getContainerBuilder() {
return
new
ContainerBuilder
(
new
ParameterBag
(
$this
->
getKernelParameters
()));
}
/**
* This method is part of the KernelInterface interface, but takes an object
* implementing LoaderInterface as its only parameter. This is part of the
* Config compoment from Symfony, which is not provided by Drupal core.
*
* Modules wishing to provide an extension to this class which uses this
* method are responsible for ensuring the Config component exists.
*/
public
function
registerContainerConfiguration
(
LoaderInterface
$loader
)
{
// We have to define this method because it's not defined in the base class
// but is part of the KernelInterface interface. However, the LoaderInterface
// class is part of the config component, which we are not using, so this
// is badness :-/
}
}
core/lib/Drupal/Core/HttpKernel.php
View file @
d1e52e00
...
...
@@ -17,9 +17,6 @@
/**
* This HttpKernel is used to manage scope changes of the DI container.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class
HttpKernel
extends
BaseHttpKernel
{
...
...
core/lib/Drupal/Core/Language/LanguageManager.php
View file @
d1e52e00
...
...
@@ -14,7 +14,7 @@
*/
class
LanguageManager
{
private
$
container
;
private
$
request
;
public
function
__construct
(
Request
$request
=
NULL
)
{
$this
->
request
=
$request
;
...
...
core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
View file @
d1e52e00
...
...
@@ -47,6 +47,9 @@ function testUninstallProcess() {
);
language_save
(
$language
);
// Make sure the language interface object gets freshly initialized.
drupal_static_reset
(
'language_manager'
);
// Check the UI language.
drupal_language_initialize
();
$this
->
assertEqual
(
language_manager
(
LANGUAGE_TYPE_INTERFACE
)
->
langcode
,
$this
->
langcode
,
t
(
'Current language: %lang'
,
array
(
'%lang'
=>
language_manager
(
LANGUAGE_TYPE_INTERFACE
)
->
langcode
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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