vanengers/symfony-console-command-lib 问题修复 & 功能扩展

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

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

vanengers/symfony-console-command-lib

最新稳定版本:v1.3.1

Composer 安装命令:

composer require vanengers/symfony-console-command-lib

包简介

Symfony Console Command library

README 文档

README

Library for Symfony console commands

Installation

composer require vanengers/symfony-console-command-lib

Usage

class MyCommand extends AbstractConsoleCommand {}

Implement the abstract methods and you are good to go.

executeCommand():

the method that actually executes the command, do not use the execute() method from the parent class

getCommandName():

this should return the name of the command for the command line

getCommandDescription():

this should return a description of the command for the command line

getOptions():

this should return an array of options for the command line Each Option will be checked for default value and value inputed by the user Look at the example

only simple types are expected: array, bool, int, string

All options are input as options and not arguments. So all options could be defaulted.

You could implicitly require an input by setting the default value to null and setting the required flag to true

Validators

You can add validators to the Option in getOptions

new Option('config', 'name param', 'string', null, true, null, [
    new FileExistsValidator(),
])

By setting default value to null and required to true, you can require a file that exists. Settting up validators is easy, just create a class that implements the IParamValidate interface and add it to the option.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固