adt/command-lock
最新稳定版本:v1.2
Composer 安装命令:
composer require adt/command-lock
包简介
Locks the command against multiple triggering
README 文档
README
namespace App\Commands; use ADT\CommandLock\CommandLock; use ADT\CommandLock\Storage\FileSystemStorage; use Exception; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; abstract class Command extends \Symfony\Component\Console\Command\Command { use CommandLock; private string $locksDir; abstract protected function executeCommand(InputInterface $input, OutputInterface $output): int; public function setLocksDir(string $locksDir) { $this->locksDir = $locksDir; } /** * @throws Exception */ protected function execute(InputInterface $input, OutputInterface $output): int { $this->setStorage(new FileSystemStorage($this->locksDir)); $this->lock(); $status = $this->executeCommand($input, $output); $this->unlock(); return $status; } }
统计信息
- 总下载量: 20.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-07