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
221
Merge Requests
221
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
8ec847cc
Commit
8ec847cc
authored
Dec 11, 2013
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1786490
by Berdir, amateescu, damiankloip, dawehner: Add caching to the state system.
parent
4b7da9ab
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
303 additions
and
111 deletions
+303
-111
core/core.services.yml
core/core.services.yml
+4
-4
core/includes/install.core.inc
core/includes/install.core.inc
+2
-4
core/lib/Drupal.php
core/lib/Drupal.php
+1
-1
core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
+4
-5
core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
+4
-5
core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
+4
-5
core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+4
-5
core/lib/Drupal/Core/Extension/CachedModuleHandler.php
core/lib/Drupal/Core/Extension/CachedModuleHandler.php
+3
-3
core/lib/Drupal/Core/KeyValueStore/State.php
core/lib/Drupal/Core/KeyValueStore/State.php
+124
-0
core/lib/Drupal/Core/KeyValueStore/StateInterface.php
core/lib/Drupal/Core/KeyValueStore/StateInterface.php
+80
-0
core/lib/Drupal/Core/Language/LanguageManager.php
core/lib/Drupal/Core/Language/LanguageManager.php
+4
-4
core/lib/Drupal/Core/Path/AliasManager.php
core/lib/Drupal/Core/Path/AliasManager.php
+0
-7
core/lib/Drupal/Core/Path/AliasWhitelist.php
core/lib/Drupal/Core/Path/AliasWhitelist.php
+4
-4
core/lib/Drupal/Core/PrivateKey.php
core/lib/Drupal/Core/PrivateKey.php
+4
-4
core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
...field/lib/Drupal/field/FieldInstanceStorageController.php
+4
-4
core/modules/field/lib/Drupal/field/FieldStorageController.php
...modules/field/lib/Drupal/field/FieldStorageController.php
+4
-4
core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
...odules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
+2
-0
core/modules/language/lib/Drupal/language/Tests/LanguageFallbackTest.php
...nguage/lib/Drupal/language/Tests/LanguageFallbackTest.php
+1
-1
core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php
...dules/locale/lib/Drupal/locale/Form/TranslateFormBase.php
+4
-4
core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
...modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
+5
-5
core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
.../rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
+3
-3
core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
...odules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
+1
-1
core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php
...ules/search/lib/Drupal/search/Form/SearchSettingsForm.php
+4
-4
core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
...s/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+2
-4
core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
.../modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+1
-0
core/modules/system/lib/Drupal/system/Form/CronForm.php
core/modules/system/lib/Drupal/system/Form/CronForm.php
+4
-4
core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php
...system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php
+4
-4
core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php
...tem/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php
+1
-1
core/modules/system/tests/modules/service_provider_test/lib/Drupal/service_provider_test/TestClass.php
...vider_test/lib/Drupal/service_provider_test/TestClass.php
+4
-4
core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php
...iews/lib/Drupal/views/EventSubscriber/RouteSubscriber.php
+4
-4
core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
.../lib/Drupal/views/Plugin/views/display/PathPluginBase.php
+4
-4
core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php
...rupal/views/Tests/EventSubscriber/RouteSubscriberTest.php
+2
-2
core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
.../Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
+2
-2
core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php
...ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php
+1
-1
core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
...Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
+2
-2
core/tests/Drupal/Tests/Core/PrivateKeyTest.php
core/tests/Drupal/Tests/Core/PrivateKeyTest.php
+2
-2
No files found.
core/core.services.yml
View file @
8ec847cc
...
...
@@ -137,10 +137,10 @@ services:
factory_class
:
Drupal\Component\Utility\Settings
factory_method
:
getSingleton
state
:
class
:
Drupal\Core\KeyValueStore\
KeyValueStoreInterfac
e
factory_method
:
get
factory_service
:
keyvalue
arguments
:
[
state
]
class
:
Drupal\Core\KeyValueStore\
Stat
e
arguments
:
[
'
@keyvalue'
]
tags
:
-
{
name
:
persist
}
queue
:
class
:
Drupal\Core\Queue\QueueFactory
arguments
:
[
'
@settings'
]
...
...
core/includes/install.core.inc
View file @
8ec847cc
...
...
@@ -456,10 +456,8 @@ function install_begin_request(&$install_state) {
$settings
[
'keyvalue_default'
]
=
'keyvalue.memory'
;
new
Settings
(
$settings
);
$container
->
register
(
'state'
,
'Drupal\Core\KeyValueStore\KeyValueStoreInterface'
)
->
setFactoryService
(
new
Reference
(
'keyvalue'
))
->
setFactoryMethod
(
'get'
)
->
addArgument
(
'state'
);
$container
->
register
(
'state'
,
'Drupal\Core\KeyValueStore\State'
)
->
addArgument
(
new
Reference
(
'keyvalue'
));
// Register Twig template engine for use during install.
CoreServiceProvider
::
registerTwig
(
$container
);
...
...
core/lib/Drupal.php
View file @
8ec847cc
...
...
@@ -288,7 +288,7 @@ public static function keyValue($collection) {
* needs to be the same across development, production, etc. environments
* (for example, the system maintenance message) should use \Drupal::config() instead.
*
* @return \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @return \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
public
static
function
state
()
{
return
static
::
$container
->
get
(
'state'
);
...
...
core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
View file @
8ec847cc
...
...
@@ -6,8 +6,7 @@
namespace
Drupal\Core\Asset
;
use
Drupal\Core\Asset\AssetCollectionOptimizerInterface
;
use
Drupal\Core\KeyValueStore\KeyValueStoreInterface
;
use
Drupal\Core\KeyValueStore\StateInterface
;
/**
* Optimizes CSS assets.
...
...
@@ -38,7 +37,7 @@ class CssCollectionOptimizer implements AssetCollectionOptimizerInterface {
/**
* The state key/value store.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -51,10 +50,10 @@ class CssCollectionOptimizer implements AssetCollectionOptimizerInterface {
* The optimizer for a single CSS asset.
* @param \Drupal\Core\Asset\AssetDumperInterface
* The dumper for optimized CSS assets.
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface
* The state key/value store.
*/
public
function
__construct
(
AssetCollectionGrouperInterface
$grouper
,
AssetOptimizerInterface
$optimizer
,
AssetDumperInterface
$dumper
,
KeyValueStor
eInterface
$state
)
{
public
function
__construct
(
AssetCollectionGrouperInterface
$grouper
,
AssetOptimizerInterface
$optimizer
,
AssetDumperInterface
$dumper
,
Stat
eInterface
$state
)
{
$this
->
grouper
=
$grouper
;
$this
->
optimizer
=
$optimizer
;
$this
->
dumper
=
$dumper
;
...
...
core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
View file @
8ec847cc
...
...
@@ -6,9 +6,8 @@
namespace
Drupal\Core\Asset
;
use
Drupal\Core\Asset\AssetCollectionRendererInterface
;
use
Drupal\Core\KeyValueStore\KeyValueStoreInterface
;
use
Drupal\Component\Utility\String
;
use
Drupal\Core\KeyValueStore\StateInterface
;
/**
* Renders CSS assets.
...
...
@@ -18,17 +17,17 @@ class CssCollectionRenderer implements AssetCollectionRendererInterface {
/**
* The state key/value store.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
/**
* Constructs a CssCollectionRenderer.
*
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface
* The state key/value store.
*/
public
function
__construct
(
KeyValueStor
eInterface
$state
)
{
public
function
__construct
(
Stat
eInterface
$state
)
{
$this
->
state
=
$state
;
}
...
...
core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
View file @
8ec847cc
...
...
@@ -6,8 +6,7 @@
namespace
Drupal\Core\Asset
;
use
Drupal\Core\Asset\AssetCollectionOptimizerInterface
;
use
Drupal\Core\KeyValueStore\KeyValueStoreInterface
;
use
Drupal\Core\KeyValueStore\StateInterface
;
/**
...
...
@@ -39,7 +38,7 @@ class JsCollectionOptimizer implements AssetCollectionOptimizerInterface {
/**
* The state key/value store.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -52,10 +51,10 @@ class JsCollectionOptimizer implements AssetCollectionOptimizerInterface {
* The optimizer for a single JS asset.
* @param \Drupal\Core\Asset\AssetDumperInterface
* The dumper for optimized JS assets.
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface
* The state key/value store.
*/
public
function
__construct
(
AssetCollectionGrouperInterface
$grouper
,
AssetOptimizerInterface
$optimizer
,
AssetDumperInterface
$dumper
,
KeyValueStor
eInterface
$state
)
{
public
function
__construct
(
AssetCollectionGrouperInterface
$grouper
,
AssetOptimizerInterface
$optimizer
,
AssetDumperInterface
$dumper
,
Stat
eInterface
$state
)
{
$this
->
grouper
=
$grouper
;
$this
->
optimizer
=
$optimizer
;
$this
->
dumper
=
$dumper
;
...
...
core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
View file @
8ec847cc
...
...
@@ -6,8 +6,7 @@
namespace
Drupal\Core\Asset
;
use
Drupal\Core\Asset\AssetCollectionRendererInterface
;
use
Drupal\Core\KeyValueStore\KeyValueStoreInterface
;
use
Drupal\Core\KeyValueStore\StateInterface
;
/**
* Renders JavaScript assets.
...
...
@@ -17,17 +16,17 @@ class JsCollectionRenderer implements AssetCollectionRendererInterface {
/**
* The state key/value store.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
/**
* Constructs a CssCollectionRenderer.
*
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface
* The state key/value store.
*/
public
function
__construct
(
KeyValueStor
eInterface
$state
)
{
public
function
__construct
(
Stat
eInterface
$state
)
{
$this
->
state
=
$state
;
}
...
...
core/lib/Drupal/Core/Extension/CachedModuleHandler.php
View file @
8ec847cc
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\Core\Extension
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
/**
* Class that manages enabled modules in a Drupal installation.
...
...
@@ -18,7 +18,7 @@ class CachedModuleHandler extends ModuleHandler implements CachedModuleHandlerIn
/**
* State key/value store.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -39,7 +39,7 @@ class CachedModuleHandler extends ModuleHandler implements CachedModuleHandlerIn
/**
* Constructs a new CachedModuleHandler object.
*/
public
function
__construct
(
array
$module_list
=
array
(),
KeyValueStor
eInterface
$state
,
CacheBackendInterface
$bootstrap_cache
)
{
public
function
__construct
(
array
$module_list
=
array
(),
Stat
eInterface
$state
,
CacheBackendInterface
$bootstrap_cache
)
{
parent
::
__construct
(
$module_list
);
$this
->
state
=
$state
;
$this
->
bootstrapCache
=
$bootstrap_cache
;
...
...
core/lib/Drupal/Core/KeyValueStore/State.php
0 → 100644
View file @
8ec847cc
<?php
/**
* @file
* Contains Drupal\Core\KeyValueStore\StateInterface.
*/
namespace
Drupal\Core\KeyValueStore
;
/**
* Provides the state system using a key value store.
*/
class
State
implements
StateInterface
{
/**
* The key value store to use.
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
*/
protected
$keyValueStore
;
/**
* Static state cache.
*
* @var array
*/
protected
$cache
=
array
();
/**
* Constructs a State object.
*
* @param \Drupal\Core\KeyValueStore\KeyValueFactory $key_value_factory
* The key value store to use.
*/
function
__construct
(
KeyValueFactory
$key_value_factory
)
{
$this
->
keyValueStore
=
$key_value_factory
->
get
(
'state'
);
}
/**
* {@inheritdoc}
*/
public
function
get
(
$key
,
$default
=
NULL
)
{
$values
=
$this
->
getMultiple
(
array
(
$key
));
return
isset
(
$values
[
$key
])
?
$values
[
$key
]
:
$default
;
}
/**
* {@inheritdoc}
*/
public
function
getMultiple
(
array
$keys
)
{
$values
=
array
();
$load
=
array
();
foreach
(
$keys
as
$key
)
{
// Check if we have a value in the cache.
if
(
isset
(
$this
->
cache
[
$key
]))
{
$values
[
$key
]
=
$this
->
cache
[
$key
];
}
// Load the value if we don't have an explicit NULL value.
elseif
(
!
array_key_exists
(
$key
,
$this
->
cache
))
{
$load
[]
=
$key
;
}
}
if
(
$load
)
{
$loaded_values
=
$this
->
keyValueStore
->
getMultiple
(
$load
);
foreach
(
$load
as
$key
)
{
// If we find a value, even one that is NULL, add it to the cache and
// return it.
if
(
isset
(
$loaded_values
[
$key
])
||
array_key_exists
(
$key
,
$loaded_values
))
{
$values
[
$key
]
=
$loaded_values
[
$key
];
$this
->
cache
[
$key
]
=
$loaded_values
[
$key
];
}
else
{
$this
->
cache
[
$key
]
=
NULL
;
}
}
}
return
$values
;
}
/**
* {@inheritdoc}
*/
public
function
set
(
$key
,
$value
)
{
$this
->
cache
[
$key
]
=
$value
;
$this
->
keyValueStore
->
set
(
$key
,
$value
);
}
/**
* {@inheritdoc}
*/
public
function
setMultiple
(
array
$data
)
{
foreach
(
$data
as
$key
=>
$value
)
{
$this
->
cache
[
$key
]
=
$value
;
}
$this
->
keyValueStore
->
setMultiple
(
$data
);
}
/**
* {@inheritdoc}
*/
public
function
delete
(
$key
)
{
$this
->
deleteMultiple
(
array
(
$key
));
}
/**
* {@inheritdoc}
*/
public
function
deleteMultiple
(
array
$keys
)
{
foreach
(
$keys
as
$key
)
{
unset
(
$this
->
cache
[
$key
]);
}
$this
->
keyValueStore
->
deleteMultiple
(
$keys
);
}
/**
* {@inheritdoc}
*/
public
function
resetCache
()
{
$this
->
cache
=
array
();
}
}
core/lib/Drupal/Core/KeyValueStore/StateInterface.php
0 → 100644
View file @
8ec847cc
<?php
/**
* @file
* Contains Drupal\Core\KeyValueStore\StateInterface.
*/
namespace
Drupal\Core\KeyValueStore
;
/**
* Defines the interface for the state system.
*/
interface
StateInterface
{
/**
* Returns the stored value for a given key.
*
* @param string $key
* The key of the data to retrieve.
* @param mixed $default
* The default value to use if the key is not found.
*
* @return mixed
* The stored value, or NULL if no value exists.
*/
public
function
get
(
$key
,
$default
=
NULL
);
/**
* Returns the stored key/value pairs for a given set of keys.
*
* @param array $keys
* A list of keys to retrieve.
*
* @return array
* An associative array of items successfully returned, indexed by key.
*/
public
function
getMultiple
(
array
$keys
);
/**
* Saves a value for a given key.
*
* @param string $key
* The key of the data to store.
* @param mixed $value
* The data to store.
*/
public
function
set
(
$key
,
$value
);
/**
* Saves key/value pairs.
*
* @param array $data
* An associative array of key/value pairs.
*/
public
function
setMultiple
(
array
$data
);
/**
* Deletes an item.
*
* @param string $key
* The item name to delete.
*/
public
function
delete
(
$key
);
/**
* Deletes multiple items.
*
* @param array $keys
* A list of item names to delete.
*/
public
function
deleteMultiple
(
array
$keys
);
/**
* Resets the static cache.
*
* This is mainly used in testing environments.
*/
public
function
resetCache
();
}
core/lib/Drupal/Core/Language/LanguageManager.php
View file @
8ec847cc
...
...
@@ -9,7 +9,7 @@
use
Drupal\Component\Utility\MapArray
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
use
Symfony\Component\HttpFoundation\Request
;
/**
...
...
@@ -27,7 +27,7 @@ class LanguageManager {
/**
* The Key/Value Store to use for state.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
=
NULL
;
...
...
@@ -65,12 +65,12 @@ class LanguageManager {
/**
* Constructs an LanguageManager object.
*
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface $state
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface $state
* (optional) The state keyvalue store. Defaults to NULL.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* (optional) The module handler service. Defaults to NULL.
*/
public
function
__construct
(
KeyValueStor
eInterface
$state
=
NULL
,
ModuleHandlerInterface
$module_handler
=
NULL
)
{
public
function
__construct
(
Stat
eInterface
$state
=
NULL
,
ModuleHandlerInterface
$module_handler
=
NULL
)
{
$this
->
state
=
$state
;
$this
->
moduleHandler
=
$module_handler
;
}
...
...
core/lib/Drupal/Core/Path/AliasManager.php
View file @
8ec847cc
...
...
@@ -20,13 +20,6 @@ class AliasManager implements AliasManagerInterface {
*/
protected
$connection
;
/**
* The Key/Value Store to use for state
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
*/
protected
$state
;
/**
* Language manager for retrieving the default langcode when none is specified.
*
...
...
core/lib/Drupal/Core/Path/AliasWhitelist.php
View file @
8ec847cc
...
...
@@ -11,7 +11,7 @@
use
Drupal\Core\Cache\CacheCollector
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\DestructableInterface
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
use
Drupal\Core\Lock\LockBackendInterface
;
use
Drupal\Core\Utility\CacheArray
;
...
...
@@ -23,7 +23,7 @@ class AliasWhitelist extends CacheCollector {
/**
* The Key/Value Store to use for state.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -43,12 +43,12 @@ class AliasWhitelist extends CacheCollector {
* The cache backend.
* @param \Drupal\Core\Lock\LockBackendInterface $lock
* The lock backend.
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface $state
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface $state
* The state keyvalue store.
* @param \Drupal\Core\Database\Connection $connection
* The database connection.
*/
public
function
__construct
(
$cid
,
CacheBackendInterface
$cache
,
LockBackendInterface
$lock
,
KeyValueStor
eInterface
$state
,
Connection
$connection
)
{
public
function
__construct
(
$cid
,
CacheBackendInterface
$cache
,
LockBackendInterface
$lock
,
Stat
eInterface
$state
,
Connection
$connection
)
{
parent
::
__construct
(
$cid
,
$cache
,
$lock
);
$this
->
state
=
$state
;
$this
->
connection
=
$connection
;
...
...
core/lib/Drupal/Core/PrivateKey.php
View file @
8ec847cc
...
...
@@ -7,7 +7,7 @@
namespace
Drupal\Core
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
use
Drupal\Component\Utility\Crypt
;
/**
...
...
@@ -18,17 +18,17 @@ class PrivateKey {
/**
* The state service.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
/**
* Constructs the token generator.
*
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface $state
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface $state
* The state service.
*/
function
__construct
(
KeyValueStor
eInterface
$state
)
{
function
__construct
(
Stat
eInterface
$state
)
{
$this
->
state
=
$state
;
}
...
...
core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
View file @
8ec847cc
...
...
@@ -16,7 +16,7 @@
use
Drupal\Component\Uuid\UuidInterface
;
use
Drupal\Core\Config\StorageInterface
;
use
Drupal\Core\Extension\ModuleHandler
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
/**
* Controller class for field instances.
...
...
@@ -45,7 +45,7 @@ class FieldInstanceStorageController extends ConfigStorageController {
/**
* The state keyvalue collection.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -68,10 +68,10 @@ class FieldInstanceStorageController extends ConfigStorageController {
* The entity manager.
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
* The module handler.
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface $state
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface $state
* The state key value store.
*/
public
function
__construct
(
$entity_type
,
array
$entity_info
,
ConfigFactory
$config_factory
,
StorageInterface
$config_storage
,
QueryFactory
$entity_query_factory
,
UuidInterface
$uuid_service
,
EntityManagerInterface
$entity_manager
,
ModuleHandler
$module_handler
,
KeyValueStor
eInterface
$state
)
{
public
function
__construct
(
$entity_type
,
array
$entity_info
,
ConfigFactory
$config_factory
,
StorageInterface
$config_storage
,
QueryFactory
$entity_query_factory
,
UuidInterface
$uuid_service
,
EntityManagerInterface
$entity_manager
,
ModuleHandler
$module_handler
,
Stat
eInterface
$state
)
{
parent
::
__construct
(
$entity_type
,
$entity_info
,
$config_factory
,
$config_storage
,
$entity_query_factory
,
$uuid_service
);
$this
->
entityManager
=
$entity_manager
;
$this
->
moduleHandler
=
$module_handler
;
...
...
core/modules/field/lib/Drupal/field/FieldStorageController.php
View file @
8ec847cc
...
...
@@ -16,7 +16,7 @@
use
Drupal\Core\Config\ConfigFactory
;
use
Drupal\Core\Config\StorageInterface
;
use
Drupal\Core\Extension\ModuleHandler
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
/**
* Controller class for fields.
...
...
@@ -40,7 +40,7 @@ class FieldStorageController extends ConfigStorageController {
/**
* The state keyvalue collection.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -63,10 +63,10 @@ class FieldStorageController extends ConfigStorageController {
* The entity manager.
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
* The module handler.
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface $state
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface $state
* The state key value store.
*/
public
function
__construct
(
$entity_type
,
array
$entity_info
,
ConfigFactory
$config_factory
,
StorageInterface
$config_storage
,
QueryFactory
$entity_query_factory
,
UuidInterface
$uuid_service
,
EntityManagerInterface
$entity_manager
,
ModuleHandler
$module_handler
,
KeyValueStor
eInterface
$state
)
{
public
function
__construct
(
$entity_type
,
array
$entity_info
,
ConfigFactory
$config_factory
,
StorageInterface
$config_storage
,
QueryFactory
$entity_query_factory
,
UuidInterface
$uuid_service
,
EntityManagerInterface
$entity_manager
,
ModuleHandler
$module_handler
,
Stat
eInterface
$state
)
{
parent
::
__construct
(
$entity_type
,
$entity_info
,
$config_factory
,
$config_storage
,
$entity_query_factory
,
$uuid_service
);
$this
->
entityManager
=
$entity_manager
;
$this
->
moduleHandler
=
$module_handler
;
...
...
core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
View file @
8ec847cc
...
...
@@ -38,6 +38,8 @@ function setUp() {
* 'insert', etc.
*/
function
assertFileHooksCalled
(
$expected
)
{
\
Drupal
::
state
()
->
resetCache
();
// Determine which hooks were called.
$actual
=
array_keys
(
array_filter
(
file_test_get_all_calls
()));
...
...
core/modules/language/lib/Drupal/language/Tests/LanguageFallbackTest.php
View file @
8ec847cc
...
...
@@ -26,7 +26,7 @@ public static function getInfo() {
/**
* The state storage service.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php
View file @
8ec847cc
...
...
@@ -11,7 +11,7 @@
use
Drupal\Core\Language\Language
;
use
Drupal\Core\Language\LanguageManager
;
use
Drupal\locale\StringStorageInterface
;
use
Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
;
use
Drupal\Core\KeyValueStore\
Stat
eInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
...
...
@@ -31,7 +31,7 @@ abstract class TranslateFormBase extends FormBase {
/**
* The state store.
*
* @var \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface
* @var \Drupal\Core\KeyValueStore\
Stat
eInterface
*/
protected
$state
;
...
...
@@ -54,12 +54,12 @@ abstract class TranslateFormBase extends FormBase {
*
* @param \Drupal\locale\StringStorageInterface $locale_storage
* The locale storage.
* @param \Drupal\Core\KeyValueStore\
KeyValueStor
eInterface $state
* @param \Drupal\Core\KeyValueStore\
Stat
eInterface $state
* The state service.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
*/
public
function
__construct
(
StringStorageInterface
$locale_storage
,
KeyValueStor
eInterface
$state
,
LanguageManager
$language_manager
)
{
public
function
__construct
(
StringStorageInterface
$locale_storage
,
Stat
eInterface
$state
,
LanguageManager
$language_manager
)
{
$this
->
localeStorage
=
$locale_storage
;
$this
->
state
=
$state
;
$this
->
languageManager
=
$language_manager
;
...
...
core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
View file @
8ec847cc
...
...
@@ -14,7 +14,7 @@
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityManagerInterface
;