diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2020-07-27 11:03:26 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2020-07-27 11:03:26 +0100 |
| commit | e2cad646727fd3b508220621c488ecce08d4b0a8 (patch) | |
| tree | a149a9a3642def82b2c211331013eedd921e4d84 /vendor/symfony | |
| parent | dc42ac50c23d8fe13cfd1281afc66b4b6ddd2050 (diff) | |
| download | webtrees-e2cad646727fd3b508220621c488ecce08d4b0a8.tar.gz webtrees-e2cad646727fd3b508220621c488ecce08d4b0a8.tar.bz2 webtrees-e2cad646727fd3b508220621c488ecce08d4b0a8.zip | |
Update vendor dependencies
Diffstat (limited to 'vendor/symfony')
| -rw-r--r-- | vendor/symfony/cache/Adapter/AbstractAdapter.php | 9 | ||||
| -rw-r--r-- | vendor/symfony/cache/Adapter/AbstractTagAwareAdapter.php | 9 | ||||
| -rw-r--r-- | vendor/symfony/cache/Adapter/ArrayAdapter.php | 9 | ||||
| -rw-r--r-- | vendor/symfony/cache/Adapter/ChainAdapter.php | 8 | ||||
| -rw-r--r-- | vendor/symfony/cache/Adapter/PhpArrayAdapter.php | 13 | ||||
| -rw-r--r-- | vendor/symfony/cache/Adapter/ProxyAdapter.php | 9 | ||||
| -rw-r--r-- | vendor/symfony/cache/Adapter/TagAwareAdapter.php | 4 | ||||
| -rw-r--r-- | vendor/symfony/cache/CacheItem.php | 5 | ||||
| -rw-r--r-- | vendor/symfony/cache/Traits/PdoTrait.php | 46 | ||||
| -rw-r--r-- | vendor/symfony/cache/Traits/RedisTrait.php | 42 | ||||
| -rw-r--r-- | vendor/symfony/translation/Translator.php | 4 | ||||
| -rw-r--r-- | vendor/symfony/var-exporter/composer.json | 2 |
12 files changed, 93 insertions, 67 deletions
diff --git a/vendor/symfony/cache/Adapter/AbstractAdapter.php b/vendor/symfony/cache/Adapter/AbstractAdapter.php index 25ce2d9235..a091091b90 100644 --- a/vendor/symfony/cache/Adapter/AbstractAdapter.php +++ b/vendor/symfony/cache/Adapter/AbstractAdapter.php @@ -43,12 +43,11 @@ abstract class AbstractAdapter implements AdapterInterface, CacheInterface, Logg throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s").', $this->maxIdLength - 24, \strlen($namespace), $namespace)); } $this->createCacheItem = \Closure::bind( - static function ($key, $value, $isHit) use ($defaultLifetime) { + static function ($key, $value, $isHit) { $item = new CacheItem(); $item->key = $key; $item->value = $v = $value; $item->isHit = $isHit; - $item->defaultLifetime = $defaultLifetime; // Detect wrapped values that encode for their expiry and creation duration // For compactness, these values are packed in the key of an array using // magic numbers in the form 9D-..-..-..-..-00-..-..-..-5F @@ -66,7 +65,7 @@ abstract class AbstractAdapter implements AdapterInterface, CacheInterface, Logg ); $getId = \Closure::fromCallable([$this, 'getId']); $this->mergeByLifetime = \Closure::bind( - static function ($deferred, $namespace, &$expiredIds) use ($getId) { + static function ($deferred, $namespace, &$expiredIds) use ($getId, $defaultLifetime) { $byLifetime = []; $now = microtime(true); $expiredIds = []; @@ -74,7 +73,9 @@ abstract class AbstractAdapter implements AdapterInterface, CacheInterface, Logg foreach ($deferred as $key => $item) { $key = (string) $key; if (null === $item->expiry) { - $ttl = 0 < $item->defaultLifetime ? $item->defaultLifetime : 0; + $ttl = 0 < $defaultLifetime ? $defaultLifetime : 0; + } elseif (0 === $item->expiry) { + $ttl = 0; } elseif (0 >= $ttl = (int) (0.1 + $item->expiry - $now)) { $expiredIds[] = $getId($key); continue; diff --git a/vendor/symfony/cache/Adapter/AbstractTagAwareAdapter.php b/vendor/symfony/cache/Adapter/AbstractTagAwareAdapter.php index 1a73d974c9..d5c6aae572 100644 --- a/vendor/symfony/cache/Adapter/AbstractTagAwareAdapter.php +++ b/vendor/symfony/cache/Adapter/AbstractTagAwareAdapter.php @@ -44,10 +44,9 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s").', $this->maxIdLength - 24, \strlen($namespace), $namespace)); } $this->createCacheItem = \Closure::bind( - static function ($key, $value, $isHit) use ($defaultLifetime) { + static function ($key, $value, $isHit) { $item = new CacheItem(); $item->key = $key; - $item->defaultLifetime = $defaultLifetime; $item->isTaggable = true; // If structure does not match what we expect return item as is (no value and not a hit) if (!\is_array($value) || !\array_key_exists('value', $value)) { @@ -72,7 +71,7 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA $getId = \Closure::fromCallable([$this, 'getId']); $tagPrefix = self::TAGS_PREFIX; $this->mergeByLifetime = \Closure::bind( - static function ($deferred, &$expiredIds) use ($getId, $tagPrefix) { + static function ($deferred, &$expiredIds) use ($getId, $tagPrefix, $defaultLifetime) { $byLifetime = []; $now = microtime(true); $expiredIds = []; @@ -80,7 +79,9 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA foreach ($deferred as $key => $item) { $key = (string) $key; if (null === $item->expiry) { - $ttl = 0 < $item->defaultLifetime ? $item->defaultLifetime : 0; + $ttl = 0 < $defaultLifetime ? $defaultLifetime : 0; + } elseif (0 === $item->expiry) { + $ttl = 0; } elseif (0 >= $ttl = (int) (0.1 + $item->expiry - $now)) { $expiredIds[] = $getId($key); continue; diff --git a/vendor/symfony/cache/Adapter/ArrayAdapter.php b/vendor/symfony/cache/Adapter/ArrayAdapter.php index d93dcbd79c..c696f3bace 100644 --- a/vendor/symfony/cache/Adapter/ArrayAdapter.php +++ b/vendor/symfony/cache/Adapter/ArrayAdapter.php @@ -26,20 +26,21 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter use ArrayTrait; private $createCacheItem; + private $defaultLifetime; /** * @param bool $storeSerialized Disabling serialization can lead to cache corruptions when storing mutable values but increases performance otherwise */ public function __construct(int $defaultLifetime = 0, bool $storeSerialized = true) { + $this->defaultLifetime = $defaultLifetime; $this->storeSerialized = $storeSerialized; $this->createCacheItem = \Closure::bind( - static function ($key, $value, $isHit) use ($defaultLifetime) { + static function ($key, $value, $isHit) { $item = new CacheItem(); $item->key = $key; $item->value = $value; $item->isHit = $isHit; - $item->defaultLifetime = $defaultLifetime; return $item; }, @@ -131,8 +132,8 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) { return false; } - if (null === $expiry && 0 < $item["\0*\0defaultLifetime"]) { - $expiry = microtime(true) + $item["\0*\0defaultLifetime"]; + if (null === $expiry && 0 < $this->defaultLifetime) { + $expiry = microtime(true) + $this->defaultLifetime; } $this->values[$key] = $value; diff --git a/vendor/symfony/cache/Adapter/ChainAdapter.php b/vendor/symfony/cache/Adapter/ChainAdapter.php index 05b8fc9c4b..fda48d1bfd 100644 --- a/vendor/symfony/cache/Adapter/ChainAdapter.php +++ b/vendor/symfony/cache/Adapter/ChainAdapter.php @@ -70,15 +70,11 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa unset($sourceMetadata[CacheItem::METADATA_TAGS]); $item->value = $sourceItem->value; - $item->expiry = $sourceMetadata[CacheItem::METADATA_EXPIRY] ?? $sourceItem->expiry; $item->isHit = $sourceItem->isHit; $item->metadata = $item->newMetadata = $sourceItem->metadata = $sourceMetadata; - if (0 < $sourceItem->defaultLifetime && $sourceItem->defaultLifetime < $defaultLifetime) { - $defaultLifetime = $sourceItem->defaultLifetime; - } - if (0 < $defaultLifetime && ($item->defaultLifetime <= 0 || $defaultLifetime < $item->defaultLifetime)) { - $item->defaultLifetime = $defaultLifetime; + if (0 < $defaultLifetime) { + $item->expiresAfter($defaultLifetime); } return $item; diff --git a/vendor/symfony/cache/Adapter/PhpArrayAdapter.php b/vendor/symfony/cache/Adapter/PhpArrayAdapter.php index b4f13d1346..2a516ee857 100644 --- a/vendor/symfony/cache/Adapter/PhpArrayAdapter.php +++ b/vendor/symfony/cache/Adapter/PhpArrayAdapter.php @@ -305,10 +305,17 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte 'function' => 'spl_autoload_call', 'args' => [$class], ]; - $i = 1 + array_search($autoloadFrame, $trace, true); - if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) { - switch ($trace[$i]['function']) { + if (\PHP_VERSION_ID >= 80000 && isset($trace[1])) { + $callerFrame = $trace[1]; + } elseif (false !== $i = array_search($autoloadFrame, $trace, true)) { + $callerFrame = $trace[++$i]; + } else { + throw $e; + } + + if (isset($callerFrame['function']) && !isset($callerFrame['class'])) { + switch ($callerFrame['function']) { case 'get_class_methods': case 'get_class_vars': case 'get_parent_class': diff --git a/vendor/symfony/cache/Adapter/ProxyAdapter.php b/vendor/symfony/cache/Adapter/ProxyAdapter.php index bccafb31cd..092470988a 100644 --- a/vendor/symfony/cache/Adapter/ProxyAdapter.php +++ b/vendor/symfony/cache/Adapter/ProxyAdapter.php @@ -33,6 +33,7 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa private $createCacheItem; private $setInnerItem; private $poolHash; + private $defaultLifetime; public function __construct(CacheItemPoolInterface $pool, string $namespace = '', int $defaultLifetime = 0) { @@ -40,8 +41,9 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa $this->poolHash = $poolHash = spl_object_hash($pool); $this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace); $this->namespaceLen = \strlen($namespace); + $this->defaultLifetime = $defaultLifetime; $this->createCacheItem = \Closure::bind( - static function ($key, $innerItem) use ($defaultLifetime, $poolHash) { + static function ($key, $innerItem) use ($poolHash) { $item = new CacheItem(); $item->key = $key; @@ -52,7 +54,6 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa $item->value = $v = $innerItem->get(); $item->isHit = $innerItem->isHit(); $item->innerItem = $innerItem; - $item->defaultLifetime = $defaultLifetime; $item->poolHash = $poolHash; // Detect wrapped values that encode for their expiry and creation duration @@ -227,8 +228,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa return false; } $item = (array) $item; - if (null === $item["\0*\0expiry"] && 0 < $item["\0*\0defaultLifetime"]) { - $item["\0*\0expiry"] = microtime(true) + $item["\0*\0defaultLifetime"]; + if (null === $item["\0*\0expiry"] && 0 < $this->defaultLifetime) { + $item["\0*\0expiry"] = microtime(true) + $this->defaultLifetime; } if ($item["\0*\0poolHash"] === $this->poolHash && $item["\0*\0innerItem"]) { diff --git a/vendor/symfony/cache/Adapter/TagAwareAdapter.php b/vendor/symfony/cache/Adapter/TagAwareAdapter.php index 7c0ee30024..735569ddb4 100644 --- a/vendor/symfony/cache/Adapter/TagAwareAdapter.php +++ b/vendor/symfony/cache/Adapter/TagAwareAdapter.php @@ -49,7 +49,6 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac $item = new CacheItem(); $item->key = $key; $item->value = $value; - $item->defaultLifetime = $protoItem->defaultLifetime; $item->expiry = $protoItem->expiry; $item->poolHash = $protoItem->poolHash; @@ -94,8 +93,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac $this->invalidateTags = \Closure::bind( static function (AdapterInterface $tagsAdapter, array $tags) { foreach ($tags as $v) { - $v->defaultLifetime = 0; - $v->expiry = null; + $v->expiry = 0; $tagsAdapter->saveDeferred($v); } diff --git a/vendor/symfony/cache/CacheItem.php b/vendor/symfony/cache/CacheItem.php index 00661e09fd..7fe37c0688 100644 --- a/vendor/symfony/cache/CacheItem.php +++ b/vendor/symfony/cache/CacheItem.php @@ -27,7 +27,6 @@ final class CacheItem implements ItemInterface protected $value; protected $isHit = false; protected $expiry; - protected $defaultLifetime; protected $metadata = []; protected $newMetadata = []; protected $innerItem; @@ -78,7 +77,7 @@ final class CacheItem implements ItemInterface public function expiresAt($expiration): self { if (null === $expiration) { - $this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null; + $this->expiry = null; } elseif ($expiration instanceof \DateTimeInterface) { $this->expiry = (float) $expiration->format('U.u'); } else { @@ -96,7 +95,7 @@ final class CacheItem implements ItemInterface public function expiresAfter($time): self { if (null === $time) { - $this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null; + $this->expiry = null; } elseif ($time instanceof \DateInterval) { $this->expiry = microtime(true) + \DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); } elseif (\is_int($time)) { diff --git a/vendor/symfony/cache/Traits/PdoTrait.php b/vendor/symfony/cache/Traits/PdoTrait.php index bec497feed..02a4db7d69 100644 --- a/vendor/symfony/cache/Traits/PdoTrait.php +++ b/vendor/symfony/cache/Traits/PdoTrait.php @@ -113,7 +113,11 @@ trait PdoTrait $table->setPrimaryKey([$this->idCol]); foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } return; @@ -144,7 +148,11 @@ trait PdoTrait throw new \DomainException(sprintf('Creating the cache table is currently not implemented for PDO driver "%s".', $this->driver)); } - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } /** @@ -256,7 +264,11 @@ trait PdoTrait } try { - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } catch (TableNotFoundException $e) { } catch (\PDOException $e) { } @@ -410,26 +422,36 @@ trait PdoTrait if ($this->conn instanceof \PDO) { $this->driver = $this->conn->getAttribute(\PDO::ATTR_DRIVER_NAME); } else { - switch ($this->driver = $this->conn->getDriver()->getName()) { - case 'mysqli': + $driver = $this->conn->getDriver(); + + switch (true) { + case $driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver: throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class)); - case 'pdo_mysql': - case 'drizzle_pdo_mysql': + + case $driver instanceof \Doctrine\DBAL\Driver\AbstractMySQLDriver: $this->driver = 'mysql'; break; - case 'pdo_sqlite': + case $driver instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver: + case $driver instanceof \Doctrine\DBAL\Driver\PDO\SQLite\Driver: $this->driver = 'sqlite'; break; - case 'pdo_pgsql': + case $driver instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver: + case $driver instanceof \Doctrine\DBAL\Driver\PDO\PgSQL\Driver: $this->driver = 'pgsql'; break; - case 'oci8': - case 'pdo_oracle': + case $driver instanceof \Doctrine\DBAL\Driver\OCI8\Driver: + case $driver instanceof \Doctrine\DBAL\Driver\PDOOracle\Driver: + case $driver instanceof \Doctrine\DBAL\Driver\PDO\OCI\Driver: $this->driver = 'oci'; break; - case 'pdo_sqlsrv': + case $driver instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver: + case $driver instanceof \Doctrine\DBAL\Driver\PDOSqlsrv\Driver: + case $driver instanceof \Doctrine\DBAL\Driver\PDO\SQLSrv\Driver: $this->driver = 'sqlsrv'; break; + default: + $this->driver = \get_class($driver); + break; } } } diff --git a/vendor/symfony/cache/Traits/RedisTrait.php b/vendor/symfony/cache/Traits/RedisTrait.php index 322eeee19b..cda180c13c 100644 --- a/vendor/symfony/cache/Traits/RedisTrait.php +++ b/vendor/symfony/cache/Traits/RedisTrait.php @@ -84,7 +84,7 @@ trait RedisTrait * * @throws InvalidArgumentException when the DSN is invalid * - * @return \Redis|\RedisCluster|\Predis\ClientInterface According to the "class" option + * @return \Redis|\RedisCluster|RedisClusterProxy|RedisProxy|\Predis\ClientInterface According to the "class" option */ public static function createConnection($dsn, array $options = []) { @@ -173,28 +173,28 @@ trait RedisTrait $initializer = function ($redis) use ($connect, $params, $dsn, $auth, $hosts) { try { @$redis->{$connect}($hosts[0]['host'] ?? $hosts[0]['path'], $hosts[0]['port'] ?? null, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']); - } catch (\RedisException $e) { - throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e->getMessage()); - } - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - $isConnected = $redis->isConnected(); - restore_error_handler(); - if (!$isConnected) { - $error = preg_match('/^Redis::p?connect\(\): (.*)/', $error, $error) ? sprintf(' (%s)', $error[1]) : ''; - throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$error.'.'); - } + set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); + $isConnected = $redis->isConnected(); + restore_error_handler(); + if (!$isConnected) { + $error = preg_match('/^Redis::p?connect\(\): (.*)/', $error, $error) ? sprintf(' (%s)', $error[1]) : ''; + throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$error.'.'); + } - if ((null !== $auth && !$redis->auth($auth)) - || ($params['dbindex'] && !$redis->select($params['dbindex'])) - || ($params['read_timeout'] && !$redis->setOption(\Redis::OPT_READ_TIMEOUT, $params['read_timeout'])) - ) { - $e = preg_replace('/^ERR /', '', $redis->getLastError()); - throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e.'.'); - } + if ((null !== $auth && !$redis->auth($auth)) + || ($params['dbindex'] && !$redis->select($params['dbindex'])) + || ($params['read_timeout'] && !$redis->setOption(\Redis::OPT_READ_TIMEOUT, $params['read_timeout'])) + ) { + $e = preg_replace('/^ERR /', '', $redis->getLastError()); + throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e.'.'); + } - if (0 < $params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) { - $redis->setOption(\Redis::OPT_TCP_KEEPALIVE, $params['tcp_keepalive']); + if (0 < $params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) { + $redis->setOption(\Redis::OPT_TCP_KEEPALIVE, $params['tcp_keepalive']); + } + } catch (\RedisException $e) { + throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e->getMessage()); } return true; @@ -228,7 +228,7 @@ trait RedisTrait } try { - $redis = new $class(null, $hosts, $params['timeout'], $params['read_timeout'], (bool) $params['persistent']); + $redis = new $class(null, $hosts, $params['timeout'], $params['read_timeout'], (bool) $params['persistent'], $params['auth'] ?? ''); } catch (\RedisClusterException $e) { throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$e->getMessage()); } diff --git a/vendor/symfony/translation/Translator.php b/vendor/symfony/translation/Translator.php index b404b54919..c4c58f054d 100644 --- a/vendor/symfony/translation/Translator.php +++ b/vendor/symfony/translation/Translator.php @@ -460,7 +460,7 @@ EOF protected function computeFallbackLocales($locale) { if (null === $this->parentLocales) { - $parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); + $this->parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); } $locales = []; @@ -473,7 +473,7 @@ EOF } while ($locale) { - $parent = $parentLocales[$locale] ?? null; + $parent = $this->parentLocales[$locale] ?? null; if ($parent) { $locale = 'root' !== $parent ? $parent : null; diff --git a/vendor/symfony/var-exporter/composer.json b/vendor/symfony/var-exporter/composer.json index f589cde093..7d4570ce21 100644 --- a/vendor/symfony/var-exporter/composer.json +++ b/vendor/symfony/var-exporter/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.1.3" + "php": ">=7.1.3" }, "require-dev": { "symfony/var-dumper": "^4.4.9|^5.0.9" |
