upgrade to laravel 8.0

This commit is contained in:
Attila Kerekes
2022-11-13 17:05:03 +01:00
committed by Attila Jozsef Kerekes
parent 43f894b58d
commit 27f58c0866
3895 changed files with 150576 additions and 124482 deletions

View File

@@ -112,7 +112,7 @@ abstract class AbstractAdapter implements AdapterInterface, CacheInterface, Logg
return $opcache;
}
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !filter_var(\ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
return $opcache;
}

View File

@@ -49,7 +49,7 @@ class ApcuAdapter extends AbstractAdapter
public static function isSupported()
{
return \function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN);
return \function_exists('apcu_fetch') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN);
}
/**
@@ -94,8 +94,8 @@ class ApcuAdapter extends AbstractAdapter
*/
protected function doClear(string $namespace)
{
return isset($namespace[0]) && class_exists(\APCuIterator::class, false) && ('cli' !== \PHP_SAPI || filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN))
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), \APC_ITER_KEY))
return isset($namespace[0]) && class_exists(\APCUIterator::class, false) && ('cli' !== \PHP_SAPI || filter_var(\ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN))
? apcu_delete(new \APCUIterator(sprintf('/^%s/', preg_quote($namespace, '/')), \APC_ITER_KEY))
: apcu_clear_cache();
}

View File

@@ -349,7 +349,7 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
if ('N;' === $value || (isset($value[2]) && ':' === $value[1])) {
return serialize($value);
}
} elseif (!is_scalar($value)) {
} elseif (!\is_scalar($value)) {
try {
$serialized = serialize($value);
} catch (\Exception $e) {

View File

@@ -53,7 +53,7 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
if (!$adapter instanceof CacheItemPoolInterface) {
throw new InvalidArgumentException(sprintf('The class "%s" does not implement the "%s" interface.', get_debug_type($adapter), CacheItemPoolInterface::class));
}
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $adapter instanceof ApcuAdapter && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $adapter instanceof ApcuAdapter && !filter_var(\ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
continue; // skip putting APCu in the chain when the backend is disabled
}

View File

@@ -345,7 +345,7 @@ EOF;
$isStaticValue = false;
}
$value = var_export($value, true);
} elseif (!is_scalar($value)) {
} elseif (!\is_scalar($value)) {
throw new InvalidArgumentException(sprintf('Cache key "%s" has non-serializable "%s" value.', $key, get_debug_type($value)));
} else {
$value = var_export($value, true);

View File

@@ -58,7 +58,7 @@ class PhpFilesAdapter extends AbstractAdapter implements PruneableInterface
{
self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time();
return \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN));
return \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN));
}
/**
@@ -234,7 +234,7 @@ class PhpFilesAdapter extends AbstractAdapter implements PruneableInterface
$isStaticValue = false;
}
$value = var_export($value, true);
} elseif (!is_scalar($value)) {
} elseif (!\is_scalar($value)) {
throw new InvalidArgumentException(sprintf('Cache key "%s" has non-serializable "%s" value.', $key, get_debug_type($value)));
} else {
$value = var_export($value, true);

View File

@@ -208,7 +208,7 @@ EOLUA;
// and removes the linked items. When the set is still not empty after
// the scan, it means we're in cluster mode and that the linked items
// are on other nodes: we move the links to a temporary set and we
// gargage collect that set from the client side.
// garbage collect that set from the client side.
$lua = <<<'EOLUA'
redis.replicate_commands()

View File

@@ -182,7 +182,7 @@ final class CacheItem implements ItemInterface
} else {
$replace = [];
foreach ($context as $k => $v) {
if (is_scalar($v)) {
if (\is_scalar($v)) {
$replace['{'.$k.'}'] = $v;
}
}

View File

@@ -51,7 +51,7 @@ class TagAwareMarshaller implements MarshallerInterface
$serialized[$id][9] = "\x5F";
}
} else {
// other arbitratry values are serialized using the decorated marshaller below
// other arbitrary values are serialized using the decorated marshaller below
$notSerialized[$id] = $value;
}
}

View File

@@ -1,13 +1,13 @@
Symfony PSR-6 implementation for caching
========================================
The Cache component provides an extended
[PSR-6](http://www.php-fig.org/psr/psr-6/) implementation for adding cache to
The Cache component provides extended
[PSR-6](https://www.php-fig.org/psr/psr-6/) implementations for adding cache to
your applications. It is designed to have a low overhead so that caching is
fastest. It ships with a few caching adapters for the most widespread and
suited to caching backends. It also provides a `doctrine/cache` proxy adapter
to cover more advanced caching needs and a proxy adapter for greater
interoperability between PSR-6 implementations.
fastest. It ships with adapters for the most widespread caching backends.
It also provides a [PSR-16](https://www.php-fig.org/psr/psr-16/) adapter,
and implementations for [symfony/cache-contracts](https://github.com/symfony/cache-contracts)'
`CacheInterface` and `TagAwareCacheInterface`.
Resources
---------

View File

@@ -394,7 +394,7 @@ trait AbstractAdapterTrait
$this->ids[$key] = $key;
if (\count($this->ids) > 1000) {
array_splice($this->ids, 0, 500); // stop memory leak if there are many keys
$this->ids = \array_slice($this->ids, 500, null, true); // stop memory leak if there are many keys
}
if (null === $this->maxIdLength) {

View File

@@ -42,7 +42,7 @@ trait ContractsTrait
public function setCallbackWrapper(?callable $callbackWrapper): callable
{
if (!isset($this->callbackWrapper)) {
$this->callbackWrapper = \Closure::fromCallable([LockRegistry::class, 'compute']);;
$this->callbackWrapper = \Closure::fromCallable([LockRegistry::class, 'compute']);
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
$this->setCallbackWrapper(null);

View File

@@ -179,7 +179,7 @@ trait RedisTrait
}
if (null === $params['class'] && \extension_loaded('redis')) {
$class = $params['redis_cluster'] ? \RedisCluster::class : (1 < \count($hosts) ? \RedisArray::class : \Redis::class);
$class = $params['redis_cluster'] ? \RedisCluster::class : (1 < \count($hosts) && !isset($params['redis_sentinel']) ? \RedisArray::class : \Redis::class);
} else {
$class = $params['class'] ?? \Predis\Client::class;
@@ -193,21 +193,29 @@ trait RedisTrait
$redis = new $class();
$initializer = static function ($redis) use ($connect, $params, $dsn, $auth, $hosts, $tls) {
$host = $hosts[0]['host'] ?? $hosts[0]['path'];
$port = $hosts[0]['port'] ?? 0;
$hostIndex = 0;
do {
$host = $hosts[$hostIndex]['host'] ?? $hosts[$hostIndex]['path'];
$port = $hosts[$hostIndex]['port'] ?? 0;
$address = false;
if (isset($hosts[0]['host']) && $tls) {
$host = 'tls://'.$host;
}
if (isset($params['redis_sentinel'])) {
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']);
if (!$address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
throw new InvalidArgumentException(sprintf('Failed to retrieve master information from master name "%s" and address "%s:%d".', $params['redis_sentinel'], $host, $port));
if (isset($hosts[$hostIndex]['host']) && $tls) {
$host = 'tls://'.$host;
}
[$host, $port] = $address;
if (!isset($params['redis_sentinel'])) {
break;
}
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']);
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
[$host, $port] = $address;
}
} while (++$hostIndex < \count($hosts) && !$address);
if (isset($params['redis_sentinel']) && !$address) {
throw new InvalidArgumentException(sprintf('Failed to retrieve master information from sentinel "%s" and dsn "%s".', $params['redis_sentinel'], $dsn));
}
try {

View File

@@ -1,7 +1,7 @@
{
"name": "symfony/cache",
"type": "library",
"description": "Provides an extended PSR-6, PSR-16 (and tags) implementation",
"description": "Provides extended PSR-6, PSR-16 (and tags) implementations",
"keywords": ["caching", "psr6"],
"homepage": "https://symfony.com",
"license": "MIT",