diff --git a/core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php b/core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php index 15a7eb26b9dadcf0baccde47b2f58b37bd9a9d3b..82a9b4a7880ea17c9d5c55f47a649f7ccb4abac6 100644 --- a/core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php +++ b/core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php @@ -6,6 +6,8 @@ */ namespace Drupal\Component\PhpStorage; + +use Drupal\Component\Utility\Settings; use Drupal\Core\StreamWrapper\PublicStream; /** @@ -32,12 +34,12 @@ class PhpStorageFactory { * An instantiated storage controller for the specified name. */ static function get($name) { - global $conf; - if (isset($conf['php_storage'][$name])) { - $configuration = $conf['php_storage'][$name]; + $conf = Settings::getSingleton()->get('php_storage'); + if (isset($conf[$name])) { + $configuration = $conf[$name]; } - elseif (isset($conf['php_storage']['default'])) { - $configuration = $conf['php_storage']['default']; + elseif (isset($conf['default'])) { + $configuration = $conf['default']; } else { $configuration = array( diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php index dbc47b9fdad7046421ca9a61368e91e16a132c7b..9ee7301687e7c157038c790f0e18bdbac1031f8c 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php @@ -7,6 +7,8 @@ namespace Drupal\Tests\Component\PhpStorage; +use Drupal\Component\Utility\Settings; + /** * Tests the simple file storage. */ @@ -21,7 +23,6 @@ public static function getInfo() { } public function setUp() { - global $conf; parent::setUp(); $dir_path = sys_get_temp_dir() . '/php'; $conf['php_storage']['simpletest'] = array( @@ -34,6 +35,7 @@ public function setUp() { // Let this read from the bin where the other instance is writing. 'bin' => 'simpletest', ); + new Settings($conf); } /** diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php index 55d01c8ee09402d86063505be96e6d069ae11feb..1e28e362d0b3a4063c55665e1049cec0fffa5a61 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php @@ -8,6 +8,7 @@ namespace Drupal\Tests\Component\PhpStorage; use Drupal\Component\PhpStorage\PhpStorageFactory; +use Drupal\Component\Utility\Settings; /** * Tests the directory mtime based PHP loader implementation. @@ -33,7 +34,6 @@ public static function getInfo() { } function setUp() { - global $conf; parent::setUp(); $this->secret = $this->randomName(); $conf['php_storage']['simpletest'] = array( @@ -41,6 +41,7 @@ function setUp() { 'directory' => sys_get_temp_dir() . '/php', 'secret' => $this->secret, ); + new Settings($conf); } /**