summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache/Adapter
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-06-22 21:23:30 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-06-22 21:25:44 +0100
commit50b23b0d007a750c2e92c88071f2224cb81db10e (patch)
tree198acc94e55214451e0975bfd410b082f1ef6df5 /vendor/symfony/cache/Adapter
parent875080585841996f3fd1f780503fec8c397e750c (diff)
downloadwebtrees-50b23b0d007a750c2e92c88071f2224cb81db10e.tar.gz
webtrees-50b23b0d007a750c2e92c88071f2224cb81db10e.tar.bz2
webtrees-50b23b0d007a750c2e92c88071f2224cb81db10e.zip
Fix: #2359 - updated language negotiation for chinese in fisharebest/localization
Diffstat (limited to 'vendor/symfony/cache/Adapter')
-rw-r--r--vendor/symfony/cache/Adapter/ArrayAdapter.php3
-rw-r--r--vendor/symfony/cache/Adapter/NullAdapter.php4
-rw-r--r--vendor/symfony/cache/Adapter/ProxyAdapter.php4
-rw-r--r--vendor/symfony/cache/Adapter/TraceableAdapter.php4
4 files changed, 9 insertions, 6 deletions
diff --git a/vendor/symfony/cache/Adapter/ArrayAdapter.php b/vendor/symfony/cache/Adapter/ArrayAdapter.php
index bbb1f846e4..defa48eed9 100644
--- a/vendor/symfony/cache/Adapter/ArrayAdapter.php
+++ b/vendor/symfony/cache/Adapter/ArrayAdapter.php
@@ -59,7 +59,8 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
// ArrayAdapter works in memory, we don't care about stampede protection
if (INF === $beta || !$item->isHit()) {
- $this->save($item->set($callback($item)));
+ $save = true;
+ $this->save($item->set($callback($item, $save)));
}
return $item->get();
diff --git a/vendor/symfony/cache/Adapter/NullAdapter.php b/vendor/symfony/cache/Adapter/NullAdapter.php
index f1bdd2bf71..54cd453565 100644
--- a/vendor/symfony/cache/Adapter/NullAdapter.php
+++ b/vendor/symfony/cache/Adapter/NullAdapter.php
@@ -42,7 +42,9 @@ class NullAdapter implements AdapterInterface, CacheInterface
*/
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
{
- return $callback(($this->createCacheItem)($key));
+ $save = true;
+
+ return $callback(($this->createCacheItem)($key), $save);
}
/**
diff --git a/vendor/symfony/cache/Adapter/ProxyAdapter.php b/vendor/symfony/cache/Adapter/ProxyAdapter.php
index 8340bdf034..cf51b90d8d 100644
--- a/vendor/symfony/cache/Adapter/ProxyAdapter.php
+++ b/vendor/symfony/cache/Adapter/ProxyAdapter.php
@@ -103,9 +103,9 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
- return $this->pool->get($this->getId($key), function ($innerItem) use ($key, $callback) {
+ return $this->pool->get($this->getId($key), function ($innerItem, bool &$save) use ($key, $callback) {
$item = ($this->createCacheItem)($key, $innerItem);
- $item->set($value = $callback($item));
+ $item->set($value = $callback($item, $save));
($this->setInnerItem)($innerItem, (array) $item);
return $value;
diff --git a/vendor/symfony/cache/Adapter/TraceableAdapter.php b/vendor/symfony/cache/Adapter/TraceableAdapter.php
index 5c294d03fd..660acf54d7 100644
--- a/vendor/symfony/cache/Adapter/TraceableAdapter.php
+++ b/vendor/symfony/cache/Adapter/TraceableAdapter.php
@@ -45,10 +45,10 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
}
$isHit = true;
- $callback = function (CacheItem $item) use ($callback, &$isHit) {
+ $callback = function (CacheItem $item, bool &$save) use ($callback, &$isHit) {
$isHit = $item->isHit();
- return $callback($item);
+ return $callback($item, $save);
};
$event = $this->start(__FUNCTION__);