kaliop/lock-command-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kaliop/lock-command-bundle

Composer 安装命令:

composer require kaliop/lock-command-bundle

包简介

Features for Symfony commands

README 文档

README

Installation

Configure repository

$ php composer.phar config repositories.kaliopConsoleBundle '{ "type": "vcs", "url": "https://github.com/kaliop/kaliop-lock-command-bundle.git" }'

Install bundle

$ php composer.phar require kaliop/lock-command-bundle

Add bundle to the Symfony kernel

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            ...
            new Kaliop\LockCommandBundle\LockCommandBundle(),
            ...
        ];
    }
}

Remove bundle

$ php composer.phar remove kaliop/lock-command-bundle

Usage

Command locker

This bundle gives the possibility to "lock" console commands in order to prevent concurrent execution.

In order to do so, you have to declare your command as a service and tag it with lock: true

services:
    test.console.command:
        class: AppBundle\Command\TestLockCommand
        tags:
            - { name: "console.command", lock: true }

As you can see, the console.command tag has available a new lock option, which can be set to either true or false. Commands registered with the lock option set to true will be locked at the command start event and unlocked at the command terminate or exception event.

Additionally, if needed, you can pass a --no-lock option on the command line when launching a command if you don't want the command to be locked for a single execution:

$ php bin/console kaliop:command:example --no-lock

统计信息

  • 总下载量: 73
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固