定制 oscarweb/microcli 二次开发

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

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

oscarweb/microcli

Composer 安装命令:

composer require oscarweb/microcli

包简介

Simple extension for text output for php on command line.

README 文档

README

Simple extension for text output for php on command line.

Install vía Composer

Just add this line to your composer.json file:

"oscarweb/microcli": "0.1.1"

or run

composer require oscarweb/microcli

Example Write

Create a new file: "example.php"

#!/usr/bin/php;
<?php
if(php_sapi_name() !== 'cli'){
	exit();
}
//- enter correct path
require 'vendor/autoload.php';

use Microcli\Microcli;

$app = new Microcli();

$app->color('success')->write('Lorem Ipsum...');

From your terminal run the file: php example.php

Example Write

Example Command

Create a new file: "command"

#!/usr/bin/php;
<?php
if(php_sapi_name() !== 'cli'){
	exit();
}
//- enter correct path
require 'vendor/autoload.php';

use Microcli\Microcli;

$app = new Microcli();

$app->addCommand('hello', function($argv) use ($app){
	$app->line();
	$app->color('success')->write('Hello World');
	$app->line();
	$app->exit();
});

$app->run($argv);

From your terminal run the file: php command hello

Example Command

You can see more examples here.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固