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 --- vendor/symfony/console/Command/LockableTrait.php | 74 ------------------------ 1 file changed, 74 deletions(-) delete mode 100644 vendor/symfony/console/Command/LockableTrait.php (limited to 'vendor/symfony/console/Command/LockableTrait.php') diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php deleted file mode 100644 index f0001cc..0000000 --- a/vendor/symfony/console/Command/LockableTrait.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\LockFactory; -use Symfony\Component\Lock\LockInterface; -use Symfony\Component\Lock\Store\FlockStore; -use Symfony\Component\Lock\Store\SemaphoreStore; - -/** - * Basic lock feature for commands. - * - * @author Geoffrey Brier - */ -trait LockableTrait -{ - private ?LockInterface $lock = null; - - private ?LockFactory $lockFactory = null; - - /** - * Locks a command. - */ - private function lock(?string $name = null, bool $blocking = false): bool - { - if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".'); - } - - if (null !== $this->lock) { - throw new LogicException('A lock is already in place.'); - } - - if (null === $this->lockFactory) { - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); - } - - $this->lockFactory = (new LockFactory($store)); - } - - $this->lock = $this->lockFactory->createLock($name ?: $this->getName()); - if (!$this->lock->acquire($blocking)) { - $this->lock = null; - - return false; - } - - return true; - } - - /** - * Releases the command lock if there is one. - */ - private function release(): void - { - if ($this->lock) { - $this->lock->release(); - $this->lock = null; - } - } -} -- cgit v1.2.3