PHPackages                             tourze/symfony-lock-command-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. tourze/symfony-lock-command-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

tourze/symfony-lock-command-bundle
==================================

A Symfony bundle that provides locking mechanism for console commands to prevent concurrent execution

1.1.0(4mo ago)03.0k7MITPHPCI passing

Since Apr 8Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/symfony-lock-command-bundle)[ Packagist](https://packagist.org/packages/tourze/symfony-lock-command-bundle)[ RSS](/packages/tourze-symfony-lock-command-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (26)Versions (8)Used By (7)

Symfony Lock Command Bundle
===========================

[](#symfony-lock-command-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/658fc4fc7b1becf7f176e96e2e719a4a289b6d65a4c2434d54da438abe801a73/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f73796d666f6e792d6c6f636b2d636f6d6d616e642d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-lock-command-bundle)[![Total Downloads](https://camo.githubusercontent.com/740a241fdeded936045c1a443b4a57d038af8c9d712efc7a75563160142d928a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f73796d666f6e792d6c6f636b2d636f6d6d616e642d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-lock-command-bundle)

A Symfony bundle that provides locking mechanism for console commands to prevent concurrent execution.

Features
--------

[](#features)

- Automatic command locking based on command class and input parameters
- Prevents multiple instances of the same command from running simultaneously
- Easy integration with Symfony console commands
- Configurable lock duration (default: 60 minutes)
- Automatic lock release after command completion or termination
- Intelligent lock key generation using command class name and input parameters
- Graceful command disabling when lock cannot be acquired
- Comprehensive logging for lock acquisition and release events

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tourze/symfony-lock-command-bundle
```

Quick Start
-----------

[](#quick-start)

1. Register the bundle in your `config/bundles.php`:

```
return [
    // ...
    Tourze\LockCommandBundle\LockCommandBundle::class => ['all' => true],
];
```

2. Create a lockable command by extending `LockableCommand`:

```
