Issue #2208475 by sun, Xano, Jalandhar, andrei.dincu: Move Settings into Drupal\Core\Site\Settings.

8.0.x
Alex Pott 2014-04-25 20:13:44 +01:00
parent 019b6f6a41
commit 8a56782390
55 changed files with 95 additions and 92 deletions

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -1,8 +1,8 @@
<?php
use Drupal\Component\Utility\Settings;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Site\Settings;
/**
* @file

View File

@ -8,8 +8,8 @@
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\StreamWrapper\LocalStream;
use Drupal\Component\PhpStorage\FileStorage;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\String;
use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PublicStream;
/**

View File

@ -1,7 +1,6 @@
<?php
use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Settings;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Config\BootstrapConfigStorageFactory;
use Drupal\Core\Database\Database;
@ -13,6 +12,7 @@ use Drupal\Core\Installer\Exception\NoProfilesException;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageManager;
use Drupal\Core\Page\DefaultHtmlPageRenderer;
use Drupal\Core\Site\Settings;
use Drupal\Core\StringTranslation\Translator\FileTranslation;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\DependencyInjection\ContainerBuilder;

View File

@ -8,11 +8,11 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\OpCodeCache;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Database\Database;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Site\Settings;
/**
* Requirement severity -- Informational message only.

View File

@ -6,8 +6,8 @@
*/
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Site\Settings;
/**
* Composes and optionally sends an e-mail message.

View File

@ -6,7 +6,7 @@
*/
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
/**
* Sets up the theming system for maintenance page.

View File

@ -9,7 +9,6 @@
*/
use Drupal\Component\Graph\Graph;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\String;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\ConfigException;

View File

@ -8,9 +8,9 @@
* You may copy this code freely under the conditions of the GPL.
*/
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Site\Settings;
define('USE_ASSERTS', FALSE);

View File

@ -9,7 +9,6 @@ namespace Drupal\Core\Authentication\Provider;
use Drupal\Core\Authentication\AuthenticationProviderInterface;
use Drupal\Core\Session\SessionManagerInterface;
use Drupal\Component\Utility\Settings;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;

View File

@ -10,7 +10,7 @@ namespace Drupal\Core\Cache;
/**
* Defines the cache backend factory.
*/
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -22,14 +22,14 @@ class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
/**
* The settings array.
*
* @var \Drupal\Component\Utility\Settings
* @var \Drupal\Core\Site\Settings
*/
protected $settings;
/**
* Constructs CacheFactory object.
*
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The settings array.
*/
function __construct(Settings $settings) {

View File

@ -8,7 +8,7 @@
namespace Drupal\Core\Config;
use Drupal\Core\Database\Database;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
/**
* Defines a factory for retrieving the config storage used pre-kernel.

View File

@ -8,7 +8,6 @@
namespace Drupal\Core;
use Drupal\Core\Cache\CacheContextsPass;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Cache\ListCacheBinsPass;
use Drupal\Core\Config\ConfigFactoryOverridePass;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
@ -28,6 +27,7 @@ use Drupal\Core\DependencyInjection\Compiler\RegisterAuthenticationPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterTwigExtensionsPass;
use Drupal\Core\Http\HttpClientSubscriberPass;
use Drupal\Core\Plugin\PluginManagerPass;
use Drupal\Core\Site\Settings;
use Drupal\Core\Theme\ThemeNegotiatorPass;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Reference;

View File

@ -7,10 +7,10 @@
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\Component\Utility\Settings;
/**
* Reverse proxy subscriber for controller requests.
@ -20,14 +20,14 @@ class ReverseProxySubscriber implements EventSubscriberInterface {
/**
* A settings object.
*
* @var \Drupal\Component\Utility\Settings
* @var \Drupal\Core\Site\Settings
*/
protected $settings;
/**
* Construct the ReverseProxySubscriber.
*
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The read-only settings object of this request.
*/
public function __construct(Settings $settings) {

View File

@ -7,8 +7,8 @@
namespace Drupal\Core\Extension;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Extension\Discovery\RecursiveExtensionFilterIterator;
use Drupal\Core\Site\Settings;
/**
* Discovers available extensions in the filesystem.

View File

@ -9,7 +9,6 @@ namespace Drupal\Core\Form;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Access\CsrfTokenGenerator;
@ -18,6 +17,7 @@ use Drupal\Core\HttpKernel;
use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\UrlGeneratorInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\Core\Url;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

View File

@ -8,7 +8,7 @@
namespace Drupal\Core\Http;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Event\SubscriberInterface;

View File

@ -6,7 +6,8 @@
*/
namespace Drupal\Core\KeyValueStore;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
@ -52,14 +53,14 @@ class KeyValueFactory implements KeyValueFactoryInterface {
/**
* The read-only settings container.
*
* @var \Drupal\Component\Utility\Settings
* @var \Drupal\Core\Site\Settings
*/
protected $settings;
/**
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The service container.
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The read-only settings container.
*/
function __construct(ContainerInterface $container, Settings $settings) {

View File

@ -7,8 +7,8 @@
namespace Drupal\Core\Mail\Plugin\Mail;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Mail\MailInterface;
use Drupal\Core\Site\Settings;
/**
* Defines the default Drupal mail backend, using PHP's native mail() function.

View File

@ -7,7 +7,7 @@
namespace Drupal\Core\PhpStorage;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PublicStream;
/**

View File

@ -7,7 +7,7 @@
namespace Drupal\Core\Queue;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
@ -28,7 +28,7 @@ class QueueFactory implements ContainerAwareInterface {
/**
* The settings object.
*
* @var \Drupal\Component\Utility\Settings
* @var \Drupal\Core\Site\Settings
*/
protected $settings;

View File

@ -15,11 +15,11 @@ use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Cmf\Component\Routing\ProviderBasedGenerator;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
use Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface;
use Drupal\Core\Site\Settings;
/**
* Generates URLs from route names and parameters.
@ -86,7 +86,7 @@ class UrlGenerator extends ProviderBasedGenerator implements UrlGeneratorInterfa
* The route processor.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config
* The config factory.
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The read only settings.
* @param \Symfony\Component\HttpKernel\Log\LoggerInterface $logger
* An optional logger for recording errors.

View File

@ -8,8 +8,8 @@
namespace Drupal\Core\Session;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Database\Connection;
use Drupal\Core\Site\Settings;
use Drupal\Core\Utility\Error;
use Symfony\Component\HttpFoundation\RequestStack;

View File

@ -8,10 +8,10 @@
namespace Drupal\Core\Session;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Database\Connection;
use Drupal\Core\Session\AnonymousUserSession;
use Drupal\Core\Session\SessionHandler;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\RequestStack;
/**

View File

@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Component\Utility\Settings.
* Contains \Drupal\Core\Site\Settings.
*/
namespace Drupal\Component\Utility;
namespace Drupal\Core\Site;
/**
* Read only settings that are initialized with the class.
@ -24,7 +24,7 @@ final class Settings {
/**
* Singleton instance.
*
* @var \Drupal\Component\Utility\Settings
* @var \Drupal\Core\Site\Settings
*/
private static $instance;
@ -34,7 +34,7 @@ final class Settings {
* A singleton is used because this class is used before the container is
* available.
*
* @return \Drupal\Component\Utility\Settings
* @return \Drupal\Core\Site\Settings
*/
public static function getInstance() {
return self::$instance;

View File

@ -8,7 +8,7 @@
namespace Drupal\Core\StreamWrapper;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
/**
* Defines a Drupal public (public://) stream wrapper class.

View File

@ -7,7 +7,7 @@
namespace Drupal\Core\StringTranslation\Translator;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
/**
* String translator using overrides from variables.
@ -20,14 +20,14 @@ class CustomStrings extends StaticTranslation {
/**
* The settings read only object.
*
* @var \Drupal\Component\Utility\Settings
* @var \Drupal\Core\Site\Settings
*/
protected $settings;
/**
* Constructs a CustomStrings object.
*
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The settings read only object.
*/
public function __construct(Settings $settings) {

View File

@ -14,8 +14,8 @@
namespace Drupal\Core\Template;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Site\Settings;
/**
* A class that defines the Twig 'trans' tag for Drupal.

View File

@ -7,11 +7,11 @@
namespace Drupal\language\HttpKernel;
use Drupal\Component\Utility\Settings;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
use Drupal\Core\Site\Settings;
use Drupal\language\ConfigurableLanguageManagerInterface;
use Drupal\language\LanguageNegotiatorInterface;
use Symfony\Component\HttpFoundation\Request;
@ -69,7 +69,7 @@ class PathProcessorLanguage implements InboundPathProcessorInterface, OutboundPa
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config
* A config factory object for retrieving configuration settings.
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The settings instance.
* @param \Drupal\language\ConfigurableLanguageManagerInterface $language_manager
* The configurable language manager.

View File

@ -8,10 +8,10 @@
namespace Drupal\language;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request;
/**
@ -43,7 +43,7 @@ class LanguageNegotiator implements LanguageNegotiatorInterface {
/**
* The settings instance.
*
* @return \Drupal\Component\Utility\Settings
* @return \Drupal\Core\Site\Settings
*/
protected $settings;
@ -84,7 +84,7 @@ class LanguageNegotiator implements LanguageNegotiatorInterface {
* The language negotiation methods plugin manager
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
* @param \Drupal\Component\Utility\Settings $settings
* @param \Drupal\Core\Site\Settings $settings
* The settings instance.
*/
public function __construct(ConfigurableLanguageManagerInterface $language_manager, PluginManagerInterface $negotiator_manager, ConfigFactoryInterface $config_factory, Settings $settings) {

View File

@ -245,8 +245,8 @@ abstract class DrupalUnitTestBase extends UnitTestBase {
// together here, it still might a keyvalue storage for anything using
// \Drupal::state() -- that's why a memory service was added in the first
// place.
$container->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

View File

@ -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();

View File

@ -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;
/**

View File

@ -7,7 +7,7 @@
namespace Drupal\system\Tests\File;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
/**
* Unmanaged copy related tests.

View File

@ -7,7 +7,7 @@
namespace Drupal\system\Tests\File;
use Drupal\Component\Utility\Settings;
use Drupal\Core\Site\Settings;
/**
* Unmanaged move related tests.

View File

@ -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')

View File

@ -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().

View File

@ -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;

View File

@ -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.

View File

@ -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().

View File

@ -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) {

View File

@ -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.

View File

@ -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('..');

View File

@ -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);

View File

@ -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';

View File

@ -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;
/**

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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 <a href="http://drupal.org/documentation/rebuild">http://drupal.org/documentation/rebuild</a>';
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 <a href=\"$rebuild_path\">rebuild script</a>";
}