hunomina/cli-oop-php 问题修复 & 功能扩展

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

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

hunomina/cli-oop-php

Composer 安装命令:

composer require hunomina/cli-oop-php

包简介

Implementation of CLI classes for PHP7.1 or higher

README 文档

README

Build Status

Description : Implementation of CLI classes for PHP7.1 or higher.

This class can be used in a php file called by a CLI with input redirection.

Console

The hunomina\Console\Console class allow you to create script that you can use for background tasks, cron tasks...

To instantiate a Console, you have to pass a folder path to the constructor. This path is where your commands locate.

The folder is then sort out and only files will be parsed.

The Console parses all the files and store all class implementing the hunomina\Command\CommandInterface in the $_commands attribute

The execute($params) method allow you to execute commands.

It the parameters match a command, it will execute it.

If it does not, it will return a failure message.

If $params is null, an empty array or equals to "['help']", the console will print all the available commands.

The console will also print a message based on the command success.

CommandInterface

The hunomina\Command\CommandInterface has 3 methods :

  • array getCommand() : Return a list of string composing the command
  • string getDescription() : Return the string description of the command (used by the help command)
  • bool execute() : Logic of the command. Return true on success and false on failure

Examples

See /tests for examples

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2018-10-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固