定制 centralapps/common-console-commands 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

centralapps/common-console-commands

Composer 安装命令:

composer require centralapps/common-console-commands

包简介

Some common symfony console commands

README 文档

README

This package provides some useful beanstalk related commands for a symfony console.

Included commands are:

  • Delete beanstalk job (top of the queue is deleted)
  • Flush a tube
  • List tubes
  • Peek ready a tube
  • Get stats on a tube

Each command extends the AbstractPheanstalkCommand class, which provides a method for getting pheanstalk and setting a dependency injection container. Pheanstalk needs to be within an array or contained such as Pimple which implements \ArrayAccess with the key on pheanstalk.

Installation

Add the following to your composer.json file

"centralapps/common-console-commands": "dev-master"

Install / update composer.

Setup

Create a console file within your application; you need to provide a setup pheanstalk object connected to your beanstalkd service.

#!/usr/bin/env php
<?php

require_once(__DIR__.'/vendor/autoload.php');
$container = array(
    'pheanstalk' => PHEANSTALK_GOES_HERE
);

$cli_application = new \Symfony\Component\Console\Application();

$commands = array(
    '\CentralApps\Commands\PheanstalkStatsCommand',
    '\CentralApps\Commands\PheanstalkListCommand',
    '\CentralApps\Commands\PheanstalkPeekReadyCommand',
    '\CentralApps\Commands\PheanstalkDeleteCommand',
    '\CentralApps\Commands\PheanstalkFlushCommand'
);

foreach ($commands as $command) {
    $command = new $command();

    if ($command instanceof \CentralApps\Commands\AcceptsContainerInterface) {
        $command->setContainer($container);
    }

    $cli_application->add($command);
}

$cli_application->run();

Usage

php console pheanstlk:list

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固