承接 idearia/wp-cli-command 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

idearia/wp-cli-command

Composer 安装命令:

composer require idearia/wp-cli-command

包简介

Simple class to create WP-CLI commands with validation with little effort.

README 文档

README

Simple class to create WP-CLI commands with validation with little effort.

Features

  • Create a WP CLI command by extending a simple class
  • Easily hook into the command lifecycle by extending methods before_run_command, before_invoke, after_invoke
  • Advanced validation by extending method validate
  • Support for sub-commands by defining public methods
  • Support for PHPDoc validation

Quick start

  1. Require wp-cli-command in your project:
    composer require idearia/wp-cli-command
    
  2. Create a new command by extending the Command class. How? Have a look at the examples folder 🙂
  3. Register your command with MyCommand::init( 'my-command' );
  4. Run the command with wp my-command.

Available hooks

In oder of execution:

  • before_run_command > Just before the command is found and executed
  • before_invoke > Just before a command is invoked
  • after_invoke > Just after a command is invoked

Example

To do

  • Make hook methods aware of the specific command being executed, in case the class contains more than one. Probably, we will need to switch away from static, in order to save $args in the class.
  • Behat tests with wp scaffold package
  • Example with subcommands
  • Find a way to execute PHPDoc validation before custom validation (maybe invoking the command and the exiting with before_invoke:{$cmd})?
  • Find a way to print actual usage, instead of relying on $usage property (how to force show_usage in subcommand.php)?

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固