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 --- .../orm/src/Cache/Region/DefaultRegion.php | 113 ------------ .../orm/src/Cache/Region/FileLockRegion.php | 194 --------------------- .../orm/src/Cache/Region/UpdateTimestampCache.php | 20 --- 3 files changed, 327 deletions(-) delete mode 100644 vendor/doctrine/orm/src/Cache/Region/DefaultRegion.php delete mode 100644 vendor/doctrine/orm/src/Cache/Region/FileLockRegion.php delete mode 100644 vendor/doctrine/orm/src/Cache/Region/UpdateTimestampCache.php (limited to 'vendor/doctrine/orm/src/Cache/Region') diff --git a/vendor/doctrine/orm/src/Cache/Region/DefaultRegion.php b/vendor/doctrine/orm/src/Cache/Region/DefaultRegion.php deleted file mode 100644 index 0576195..0000000 --- a/vendor/doctrine/orm/src/Cache/Region/DefaultRegion.php +++ /dev/null @@ -1,113 +0,0 @@ -name; - } - - public function contains(CacheKey $key): bool - { - return $this->cacheItemPool->hasItem($this->getCacheEntryKey($key)); - } - - public function get(CacheKey $key): CacheEntry|null - { - $item = $this->cacheItemPool->getItem($this->getCacheEntryKey($key)); - $entry = $item->isHit() ? $item->get() : null; - - if (! $entry instanceof CacheEntry) { - return null; - } - - return $entry; - } - - public function getMultiple(CollectionCacheEntry $collection): array|null - { - $keys = array_map( - $this->getCacheEntryKey(...), - $collection->identifiers, - ); - /** @var iterable $items */ - $items = $this->cacheItemPool->getItems($keys); - if ($items instanceof Traversable) { - $items = iterator_to_array($items); - } - - $result = []; - foreach ($keys as $arrayKey => $cacheKey) { - if (! isset($items[$cacheKey]) || ! $items[$cacheKey]->isHit()) { - return null; - } - - $entry = $items[$cacheKey]->get(); - if (! $entry instanceof CacheEntry) { - return null; - } - - $result[$arrayKey] = $entry; - } - - return $result; - } - - public function put(CacheKey $key, CacheEntry $entry, Lock|null $lock = null): bool - { - $item = $this->cacheItemPool - ->getItem($this->getCacheEntryKey($key)) - ->set($entry); - - if ($this->lifetime > 0) { - $item->expiresAfter($this->lifetime); - } - - return $this->cacheItemPool->save($item); - } - - public function evict(CacheKey $key): bool - { - return $this->cacheItemPool->deleteItem($this->getCacheEntryKey($key)); - } - - public function evictAll(): bool - { - return $this->cacheItemPool->clear(self::REGION_PREFIX . $this->name); - } - - private function getCacheEntryKey(CacheKey $key): string - { - return self::REGION_PREFIX . $this->name . self::REGION_KEY_SEPARATOR . strtr($key->hash, '{}()/\@:', '________'); - } -} diff --git a/vendor/doctrine/orm/src/Cache/Region/FileLockRegion.php b/vendor/doctrine/orm/src/Cache/Region/FileLockRegion.php deleted file mode 100644 index bedd6a6..0000000 --- a/vendor/doctrine/orm/src/Cache/Region/FileLockRegion.php +++ /dev/null @@ -1,194 +0,0 @@ -getLockFileName($key); - - if (! is_file($filename)) { - return false; - } - - $time = $this->getLockTime($filename); - $content = $this->getLockContent($filename); - - if ($content === false || $time === false) { - @unlink($filename); - - return false; - } - - if ($lock && $content === $lock->value) { - return false; - } - - // outdated lock - if ($time + $this->lockLifetime <= time()) { - @unlink($filename); - - return false; - } - - return true; - } - - private function getLockFileName(CacheKey $key): string - { - return $this->directory . DIRECTORY_SEPARATOR . $key->hash . '.' . self::LOCK_EXTENSION; - } - - private function getLockContent(string $filename): string|false - { - return @file_get_contents($filename); - } - - private function getLockTime(string $filename): int|false - { - return @fileatime($filename); - } - - public function getName(): string - { - return $this->region->getName(); - } - - public function contains(CacheKey $key): bool - { - if ($this->isLocked($key)) { - return false; - } - - return $this->region->contains($key); - } - - public function get(CacheKey $key): CacheEntry|null - { - if ($this->isLocked($key)) { - return null; - } - - return $this->region->get($key); - } - - public function getMultiple(CollectionCacheEntry $collection): array|null - { - if (array_filter(array_map($this->isLocked(...), $collection->identifiers))) { - return null; - } - - return $this->region->getMultiple($collection); - } - - public function put(CacheKey $key, CacheEntry $entry, Lock|null $lock = null): bool - { - if ($this->isLocked($key, $lock)) { - return false; - } - - return $this->region->put($key, $entry); - } - - public function evict(CacheKey $key): bool - { - if ($this->isLocked($key)) { - @unlink($this->getLockFileName($key)); - } - - return $this->region->evict($key); - } - - public function evictAll(): bool - { - // The check below is necessary because on some platforms glob returns false - // when nothing matched (even though no errors occurred) - $filenames = glob(sprintf('%s/*.%s', $this->directory, self::LOCK_EXTENSION)) ?: []; - - foreach ($filenames as $filename) { - @unlink($filename); - } - - return $this->region->evictAll(); - } - - public function lock(CacheKey $key): Lock|null - { - if ($this->isLocked($key)) { - return null; - } - - $lock = Lock::createLockRead(); - $filename = $this->getLockFileName($key); - - if (@file_put_contents($filename, $lock->value, LOCK_EX) === false) { - return null; - } - - chmod($filename, 0664); - - return $lock; - } - - public function unlock(CacheKey $key, Lock $lock): bool - { - if ($this->isLocked($key, $lock)) { - return false; - } - - return @unlink($this->getLockFileName($key)); - } -} diff --git a/vendor/doctrine/orm/src/Cache/Region/UpdateTimestampCache.php b/vendor/doctrine/orm/src/Cache/Region/UpdateTimestampCache.php deleted file mode 100644 index aa75a90..0000000 --- a/vendor/doctrine/orm/src/Cache/Region/UpdateTimestampCache.php +++ /dev/null @@ -1,20 +0,0 @@ -put($key, new TimestampCacheEntry()); - } -} -- cgit v1.2.3