From 05e38eadbeb3de19e5b26003c2b401e00bb71df4 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 18 Oct 2026 00:08:23 +0200 Subject: =?UTF-8?q?sortie=20de=20vendor=20du=20d=C3=A9p=C3=B4t,=20oubli=20?= =?UTF-8?q?dans=20config-template.ini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../symfony/cache/Marshaller/DefaultMarshaller.php | 98 ---------------------- 1 file changed, 98 deletions(-) delete mode 100644 vendor/symfony/cache/Marshaller/DefaultMarshaller.php (limited to 'vendor/symfony/cache/Marshaller/DefaultMarshaller.php') diff --git a/vendor/symfony/cache/Marshaller/DefaultMarshaller.php b/vendor/symfony/cache/Marshaller/DefaultMarshaller.php deleted file mode 100644 index 34bbeb8..0000000 --- a/vendor/symfony/cache/Marshaller/DefaultMarshaller.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Cache\Marshaller; - -use Symfony\Component\Cache\Exception\CacheException; - -/** - * Serializes/unserializes values using igbinary_serialize() if available, serialize() otherwise. - * - * @author Nicolas Grekas - */ -class DefaultMarshaller implements MarshallerInterface -{ - private bool $useIgbinarySerialize = true; - private bool $throwOnSerializationFailure = false; - - public function __construct(?bool $useIgbinarySerialize = null, bool $throwOnSerializationFailure = false) - { - if (null === $useIgbinarySerialize) { - $useIgbinarySerialize = \extension_loaded('igbinary') && version_compare('3.1.6', phpversion('igbinary'), '<='); - } elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || version_compare('3.1.6', phpversion('igbinary'), '>'))) { - throw new CacheException(\extension_loaded('igbinary') ? 'Please upgrade the "igbinary" PHP extension to v3.1.6 or higher.' : 'The "igbinary" PHP extension is not loaded.'); - } - $this->useIgbinarySerialize = $useIgbinarySerialize; - $this->throwOnSerializationFailure = $throwOnSerializationFailure; - } - - public function marshall(array $values, ?array &$failed): array - { - $serialized = $failed = []; - - foreach ($values as $id => $value) { - try { - if ($this->useIgbinarySerialize) { - $serialized[$id] = igbinary_serialize($value); - } else { - $serialized[$id] = serialize($value); - } - } catch (\Exception $e) { - if ($this->throwOnSerializationFailure) { - throw new \ValueError($e->getMessage(), 0, $e); - } - $failed[] = $id; - } - } - - return $serialized; - } - - public function unmarshall(string $value): mixed - { - if ('b:0;' === $value) { - return false; - } - if ('N;' === $value) { - return null; - } - static $igbinaryNull; - if ($value === $igbinaryNull ??= \extension_loaded('igbinary') ? igbinary_serialize(null) : false) { - return null; - } - $unserializeCallbackHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback'); - try { - if (':' === ($value[1] ?? ':')) { - if (false !== $value = unserialize($value)) { - return $value; - } - } elseif (false === $igbinaryNull) { - throw new \RuntimeException('Failed to unserialize values, did you forget to install the "igbinary" extension?'); - } elseif (null !== $value = igbinary_unserialize($value)) { - return $value; - } - - throw new \DomainException(error_get_last() ? error_get_last()['message'] : 'Failed to unserialize values.'); - } catch (\Error $e) { - throw new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine()); - } finally { - ini_set('unserialize_callback_func', $unserializeCallbackHandler); - } - } - - /** - * @internal - */ - public static function handleUnserializeCallback(string $class): never - { - throw new \DomainException('Class not found: '.$class); - } -} -- cgit v1.2.3