{"id":22648236,"url":"https://github.com/matthimatiker/commandlockingbundle","last_synced_at":"2025-06-10T15:31:09.702Z","repository":{"id":62525270,"uuid":"58777080","full_name":"Matthimatiker/CommandLockingBundle","owner":"Matthimatiker","description":"Adds an optional locking feature to all console commands that can be used to prevent parallel execution.","archived":false,"fork":false,"pushed_at":"2016-05-29T19:58:42.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T07:12:09.009Z","etag":null,"topics":["bundle","cli","locking","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Matthimatiker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-13T22:52:20.000Z","updated_at":"2016-07-08T20:15:22.000Z","dependencies_parsed_at":"2022-11-02T14:15:40.578Z","dependency_job_id":null,"html_url":"https://github.com/Matthimatiker/CommandLockingBundle","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matthimatiker%2FCommandLockingBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matthimatiker%2FCommandLockingBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matthimatiker%2FCommandLockingBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matthimatiker%2FCommandLockingBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Matthimatiker","download_url":"https://codeload.github.com/Matthimatiker/CommandLockingBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matthimatiker%2FCommandLockingBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259101221,"owners_count":22805234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","cli","locking","php","symfony","symfony-bundle"],"created_at":"2024-12-09T07:55:31.233Z","updated_at":"2025-06-10T15:31:09.652Z","avatar_url":"https://github.com/Matthimatiker.png","language":"PHP","readme":"# CommandLockingBundle #\n\n[![Build Status](https://travis-ci.org/Matthimatiker/CommandLockingBundle.svg?branch=master)](https://travis-ci.org/Matthimatiker/CommandLockingBundle)\n[![Coverage Status](https://coveralls.io/repos/github/Matthimatiker/CommandLockingBundle/badge.svg?branch=master)](https://coveralls.io/github/Matthimatiker/CommandLockingBundle?branch=master)\n\nSometimes you want to ensure that a Symfony console command does not run in parallel.\nThis bundle adds an optional locking feature to all console commands that can be used to prevent parallel execution.\n\n## Installation ##\n\nInstall the bundle via [Composer](https://getcomposer.org):\n\n    composer require matthimatiker/command-locking-bundle\n    \nThen register the bundle in your ``AppKernel``:\n\n    \u003c?php\n    // app/AppKernel.php\n    \n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            new \\Matthimatiker\\CommandLockingBundle\\MatthimatikerCommandLockingBundle()\n        );\n        // ...\n    }\n\n## Usage ##\n\nSimply pass the ``--lock`` option to *any* command to ensure that parallel runs are prohibited:\n\n    app/console cache:warmup --lock\n    \nIf the command did not terminate yet and the same command is called again (in lock mode), then\nit is simply skipped and a notice is shown.\n\nThe default locking implementation relies on the filesystem and uses Symfony's \n[LockHandler](https://symfony.com/doc/current/components/filesystem/lock_handler.html). \nThis avoids parallel execution as long as your application runs on a single system.\nIf you need a distributed lock, then you will have to write your own lock manager.\n\n### Custom Lock Managers ###\n\nA custom lock manager must implement ``\\Matthimatiker\\CommandLockingBundle\\Locking\\LockManagerInterface``.\nAfterwards it must be registered as service and tagged as ``matthimatiker_command_locking.console.lock_manager``:\n\n    my.custom_lock_manager:\n        class: My\\Custom\\LockManager\n        tags:\n            - { name: matthimatiker_command_locking.console.lock_manager, alias: custom }\n\nAn alias must be defined together with the tag (``custom`` in this example) and is used to reference \nthe new lock manager:\n\n    app/console cache:warmup --lock=custom\n\n## Known Issues ##\n\nWhen sub-command are called as described in the [official documentation](http://symfony.com/doc/current/components/console/introduction.html#calling-an-existing-command),\nthen locking cannot be used for the sub-commands as the life-cycle events are not fired.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthimatiker%2Fcommandlockingbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthimatiker%2Fcommandlockingbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthimatiker%2Fcommandlockingbundle/lists"}