gepur-it/sic-bundle 问题修复 & 功能扩展

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

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

gepur-it/sic-bundle

Composer 安装命令:

composer require gepur-it/sic-bundle

包简介

Single Instance Command Bundle

README 文档

README

Single Instance Console Command Bundle

provides the ability to ban more than one command instance

add bundle in bundles.php

return [
   ...
   GepurIt\SingleInstanceCommandBundle\SingleInstanceCommandBundle::class => ['all' => true],
   ...
];

to mark command as single instance, add interface to your command, and add method getLockName()

class MyCommand extends Command implements SingleInstanceInterface {
    ...
    
    /**
     * get`s lock name for command execution, based on input
     * @param InputInterface $input
     * @return string
     */
    public function getLockName(InputInterface $input): string
    {
        return $this->getName();
    }
    
    ...
}

to allow to run the same command with different args, use $input in getLockName() method


class MyCommand extends Command implements SingleInstanceInterface {
    ...
    
    /**
     * get`s lock name for command execution, based on input
     * @param InputInterface $input
     * @return string
     */
    public function getLockName(InputInterface $input): string
    {
        return $this->getName().':'.$input->getArgument('myArg');
    }
    
    ...
}

统计信息

  • 总下载量: 7.92k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 13
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固