diff --git a/core/authorize.php b/core/authorize.php
index 982b9938ebf..46202ade8d4 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -20,7 +20,7 @@
* @link authorize Authorized operation helper functions @endlink
*/
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
use Drupal\Core\Page\DefaultHtmlPageRenderer;
// Change the directory to the Drupal root.
diff --git a/core/core.services.yml b/core/core.services.yml
index 9b9c80bdda6..a1e997e3309 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -145,8 +145,8 @@ services:
class: Drupal\Component\Serialization\Yaml
settings:
- class: Drupal\Component\Utility\Settings
- factory_class: Drupal\Component\Utility\Settings
+ class: Drupal\Core\Site\Settings
+ factory_class: Drupal\Core\Site\Settings
factory_method: getInstance
state:
class: Drupal\Core\State\State
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 83aa3075acf..8c7c82e786d 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -6,7 +6,6 @@
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\NestedArray;
-use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Timer;
use Drupal\Component\Utility\Unicode;
@@ -15,6 +14,7 @@ use Drupal\Core\DrupalKernel;
use Drupal\Core\Database\Database;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\Extension\ExtensionDiscovery;
+use Drupal\Core\Site\Settings;
use Drupal\Core\Utility\Title;
use Drupal\Core\Utility\Error;
use Symfony\Component\ClassLoader\ApcClassLoader;
diff --git a/core/includes/common.inc b/core/includes/common.inc
index a60ff1c0fe3..20a76ce0aa8 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -13,7 +13,6 @@ use Drupal\Component\Serialization\Yaml;
use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Number;
-use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\SortArray;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Tags;
@@ -21,6 +20,7 @@ use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
+use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\PhpStorage\PhpStorageFactory;
diff --git a/core/includes/database.inc b/core/includes/database.inc
index 0197377c5df..34994a82139 100644
--- a/core/includes/database.inc
+++ b/core/includes/database.inc
@@ -1,8 +1,8 @@
register('settings', 'Drupal\Component\Utility\Settings')
- ->setFactoryClass('Drupal\Component\Utility\Settings')
+ $container->register('settings', 'Drupal\Core\Site\Settings')
+ ->setFactoryClass('Drupal\Core\Site\Settings')
->setFactoryMethod('getInstance');
$container
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 1579e4ef0c2..5aba155c570 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -9,7 +9,6 @@ namespace Drupal\simpletest;
use Drupal\Component\Utility\Random;
use Drupal\Core\Database\Database;
-use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\String;
use Drupal\Core\Config\ConfigImporter;
use Drupal\Core\Config\StorageComparer;
@@ -20,6 +19,7 @@ use Drupal\Core\DrupalKernel;
use Drupal\Core\Language\Language;
use Drupal\Core\Session\AccountProxy;
use Drupal\Core\Session\AnonymousUserSession;
+use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PublicStream;
use Drupal\Core\Utility\Error;
use Symfony\Component\HttpFoundation\Request;
@@ -1349,7 +1349,7 @@ abstract class TestBase {
* @param $value
* The value of the setting.
*
- * @see \Drupal\Component\Utility\Settings::get()
+ * @see \Drupal\Core\Site\Settings::get()
*/
protected function settingsSet($name, $value) {
$settings = Settings::getAll();
diff --git a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
index aaf96125f62..aaca572fbb0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
@@ -7,8 +7,8 @@
namespace Drupal\system\Tests\DrupalKernel;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\DrupalKernel;
+use Drupal\Core\Site\Settings;
use Drupal\simpletest\DrupalUnitTestBase;
/**
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php
index ee8affff1fe..ecd131099b2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php
@@ -7,7 +7,7 @@
namespace Drupal\system\Tests\File;
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
/**
* Unmanaged copy related tests.
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php
index 60e6bbe12e2..86a933074cd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php
@@ -7,7 +7,7 @@
namespace Drupal\system\Tests\File;
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
/**
* Unmanaged move related tests.
diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php
index 4b48cfbc2dd..396f0280a18 100644
--- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php
@@ -52,8 +52,8 @@ abstract class StorageTestBase extends UnitTestBase {
->register('service_container', 'Symfony\Component\DependencyInjection\ContainerBuilder')
->setSynthetic(TRUE);
$this->container->set('service_container', $this->container);
- $this->container->register('settings', 'Drupal\Component\Utility\Settings')
- ->setFactoryClass('Drupal\Component\Utility\Settings')
+ $this->container->register('settings', 'Drupal\Core\Site\Settings')
+ ->setFactoryClass('Drupal\Core\Site\Settings')
->setFactoryMethod('getInstance');
$this->container
->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueFactory')
diff --git a/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
index 0f6f6aa22c2..e55e056355b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
@@ -7,8 +7,8 @@
namespace Drupal\system\Tests\Mail;
+use Drupal\Core\Site\Settings;
use Drupal\simpletest\WebTestBase;
-use Drupal\Component\Utility\Settings;
/**
* Tests for drupal_html_to_text().
diff --git a/core/modules/system/lib/Drupal/system/Tests/PhpStorage/PhpStorageFactoryTest.php b/core/modules/system/lib/Drupal/system/Tests/PhpStorage/PhpStorageFactoryTest.php
index 5ff16d37a3b..d7e4f3482bd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/PhpStorage/PhpStorageFactoryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/PhpStorage/PhpStorageFactoryTest.php
@@ -8,8 +8,8 @@
namespace Drupal\system\Tests\PhpStorage;
use Drupal\Component\PhpStorage\MTimeProtectedFileStorage;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\PhpStorage\PhpStorageFactory;
+use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PublicStream;
use Drupal\simpletest\DrupalUnitTestBase;
use Drupal\system\PhpStorage\MockPhpStorage;
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php
index cf047ad450d..5ea0bdac2f5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php
@@ -7,8 +7,8 @@
namespace Drupal\system\Tests\System;
+use Drupal\Core\Site\Settings;
use Drupal\simpletest\UnitTestBase;
-use Drupal\Component\Utility\Settings;
/**
* Tests the drupal_rewrite_settings() function.
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 421491af066..47c09336502 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -8,8 +8,8 @@
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Database\Database;
use Drupal\Core\Language\Language;
+use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PublicStream;
-use Drupal\Component\Utility\Settings;
/**
* Implements hook_requirements().
diff --git a/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccessCheck.php b/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccessCheck.php
index 89bbb1da02b..5fba57fc763 100644
--- a/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccessCheck.php
+++ b/core/modules/update/lib/Drupal/update/Access/UpdateManagerAccessCheck.php
@@ -7,9 +7,9 @@
namespace Drupal\update\Access;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Site\Settings;
use Symfony\Component\Routing\Route;
use Symfony\Component\HttpFoundation\Request;
@@ -21,14 +21,14 @@ class UpdateManagerAccessCheck implements AccessInterface {
/**
* Settings Service.
*
- * @var \Drupal\Component\Utility\Settings
+ * @var \Drupal\Core\Site\Settings
*/
protected $settings;
/**
* Constructs a UpdateManagerAccessCheck object.
*
- * @param \Drupal\Component\Utility\Settings $settings
+ * @param \Drupal\Core\Site\Settings $settings
* The read-only settings container.
*/
public function __construct(Settings $settings) {
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index db3b8931144..548ee636447 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -11,7 +11,7 @@
* ability to install contributed modules and themes via an user interface.
*/
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
// These are internally used constants for this code, do not modify.
diff --git a/core/rebuild.php b/core/rebuild.php
index 382387c6334..3e8ed1282c1 100644
--- a/core/rebuild.php
+++ b/core/rebuild.php
@@ -11,7 +11,7 @@
*/
use Drupal\Component\Utility\Crypt;
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
// Change the directory to the Drupal root.
chdir('..');
diff --git a/core/scripts/rebuild_token_calculator.sh b/core/scripts/rebuild_token_calculator.sh
index c206e0b143b..729d34d64d3 100755
--- a/core/scripts/rebuild_token_calculator.sh
+++ b/core/scripts/rebuild_token_calculator.sh
@@ -11,7 +11,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
require_once dirname(__DIR__) . '/includes/bootstrap.inc';
use Drupal\Component\Utility\Crypt;
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 1f09534dde2..a953dd7465b 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -5,10 +5,10 @@
* This script runs Drupal tests from command line.
*/
-use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\Timer;
use Drupal\Core\Database\Database;
use Drupal\Core\DrupalKernel;
+use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request;
require_once __DIR__ . '/../vendor/autoload.php';
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
index eb1f40b1a47..0f619075be1 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
@@ -8,8 +8,8 @@
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\Cache\CacheFactory;
+use Drupal\Core\Site\Settings;
use Drupal\Tests\UnitTestCase;
/**
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ReverseProxySubscriberUnitTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ReverseProxySubscriberUnitTest.php
index e62befe41ac..e3c8db0ef24 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/ReverseProxySubscriberUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ReverseProxySubscriberUnitTest.php
@@ -7,8 +7,8 @@
namespace Drupal\Tests\Core\EventSubscriber;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\EventSubscriber\ReverseProxySubscriber;
+use Drupal\Core\Site\Settings;
use Drupal\Tests\UnitTestCase;
/**
@@ -73,7 +73,7 @@ class ReverseProxySubscriberUnitTest extends UnitTestCase {
* \Symfony\Component\HttpFoundation\Request::setTrustedProxies() should
* always be called when reverse proxy settings are enabled.
*
- * @param \Drupal\Component\Utility\Settings $settings
+ * @param \Drupal\Core\Site\Settings $settings
* The settings object that holds reverse proxy configuration.
*/
protected function trustedHeadersAreSet(Settings $settings) {
diff --git a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
index 9197085666e..8f877f7f488 100644
--- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
+++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
@@ -7,12 +7,12 @@
namespace Drupal\Tests\Core\PathProcessor;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\Language\Language;
use Drupal\Core\PathProcessor\PathProcessorAlias;
use Drupal\Core\PathProcessor\PathProcessorDecode;
use Drupal\Core\PathProcessor\PathProcessorFront;
use Drupal\Core\PathProcessor\PathProcessorManager;
+use Drupal\Core\Site\Settings;
use Drupal\language\HttpKernel\PathProcessorLanguage;
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
use Symfony\Component\HttpFoundation\Request;
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
index d1c59c93fd3..151b74907db 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
@@ -7,10 +7,10 @@
namespace Drupal\Tests\Core\Routing;
-use Drupal\Component\Utility\Settings;
use Drupal\Core\PathProcessor\PathProcessorAlias;
use Drupal\Core\PathProcessor\PathProcessorManager;
use Drupal\Core\Routing\UrlGenerator;
+use Drupal\Core\Site\Settings;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Route;
diff --git a/core/tests/Drupal/Tests/Component/Utility/SettingsTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
similarity index 69%
rename from core/tests/Drupal/Tests/Component/Utility/SettingsTest.php
rename to core/tests/Drupal/Tests/Core/Site/SettingsTest.php
index 1c913c996d5..541cbe8b537 100644
--- a/core/tests/Drupal/Tests/Component/Utility/SettingsTest.php
+++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
@@ -2,18 +2,18 @@
/**
* @file
- * Contains \Drupal\Tests\Component\Utility\SettingsTest.php
+ * Contains \Drupal\Tests\Core\Site\SettingsTest.
*/
-namespace Drupal\Tests\Component\Utility;
+namespace Drupal\Tests\Core\Site;
-use Drupal\Component\Utility\Settings;
+use Drupal\Core\Site\Settings;
use Drupal\Tests\UnitTestCase;
/**
- * Tests read only settings.
+ * Tests read-only settings.
*
- * @see \Drupal\Component\Utility\Settings
+ * @coversDefaultClass \Drupal\Core\Site\Settings
*/
class SettingsTest extends UnitTestCase {
@@ -25,34 +25,36 @@ class SettingsTest extends UnitTestCase {
protected $config = array();
/**
- * The settings object to test.
+ * The class under test.
*
- * @var \Drupal\Component\Utility\Settings
+ * @var \Drupal\Core\Site\Settings
*/
protected $settings;
+ /**
+ * {@inheritdoc}
+ */
public static function getInfo() {
return array(
- 'name' => 'Read-only settings test',
- 'description' => 'Confirm that \Drupal\Component\Utility\Settings is working.',
+ 'name' => '\Drupal\Core\Site\Settings unit test',
+ 'description' => '',
'group' => 'Common',
);
}
/**
- * Setup a basic configuration array.
+ * @covers ::__construct
*/
public function setUp(){
$this->config = array(
'one' => '1',
'two' => '2',
);
-
$this->settings = new Settings($this->config);
}
/**
- * Tests Settings::get().
+ * @covers ::get
*/
public function testGet() {
// Test stored settings.
@@ -65,16 +67,16 @@ class SettingsTest extends UnitTestCase {
}
/**
- * Test Settings::getAll().
+ * @covers ::getAll
*/
public function testGetAll() {
$this->assertEquals($this->config, Settings::getAll());
}
/**
- * Tests Settings::getInstance().
+ * @covers ::getInstance
*/
- public function testGetSingleton() {
+ public function testGetInstance() {
$singleton = $this->settings->getInstance();
$this->assertEquals($singleton, $this->settings);
}
diff --git a/core/update.php b/core/update.php
index 9657ae1beca..3bac378545e 100644
--- a/core/update.php
+++ b/core/update.php
@@ -14,9 +14,9 @@
* back to its original state!
*/
-use Drupal\Component\Utility\Settings;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Page\DefaultHtmlPageRenderer;
+use Drupal\Core\Site\Settings;
use Drupal\Core\Update\Form\UpdateScriptSelectionForm;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/index.php b/index.php
index 4916a6c1cee..a453ecc1f91 100644
--- a/index.php
+++ b/index.php
@@ -8,6 +8,8 @@
* See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
*/
+use Drupal\Core\Site\Settings;
+
require_once __DIR__ . '/core/vendor/autoload.php';
require_once __DIR__ . '/core/includes/bootstrap.inc';
@@ -16,7 +18,7 @@ try {
}
catch (Exception $e) {
$message = 'If you have just changed code (for example deployed a new module or moved an existing one) read http://drupal.org/documentation/rebuild';
- if (\Drupal\Component\Utility\Settings::get('rebuild_access', FALSE)) {
+ if (Settings::get('rebuild_access', FALSE)) {
$rebuild_path = $GLOBALS['base_url'] . '/rebuild.php';
$message .= " or run the rebuild script";
}