Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
297
Merge Requests
297
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
4664d8af
Commit
4664d8af
authored
Nov 11, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2113621
by catch, ParisLiakos: Convert PhpStorageFactory from global to settings.
parent
36b646c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php
core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php
+7
-5
core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php
...sts/Drupal/Tests/Component/PhpStorage/FileStorageTest.php
+3
-1
core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
...ts/Component/PhpStorage/MTimeProtectedFileStorageTest.php
+2
-1
No files found.
core/lib/Drupal/Component/PhpStorage/PhpStorageFactory.php
View file @
4664d8af
...
...
@@ -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
(
...
...
core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php
View file @
4664d8af
...
...
@@ -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
);
}
/**
...
...
core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
View file @
4664d8af
...
...
@@ -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
);
}
/**
...
...
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