initphp/console
最新稳定版本:2.0
Composer 安装命令:
composer require initphp/console
包简介
It is a simple helper library that will allow you to write your console/cli application with PHP.
README 文档
README
It is a simple helper library that will allow you to write your console/cli application with PHP.
Requirements
- PHP 7.2 or higher
Installation
composer require initphp/console
Usage
#!/usr/bin/env php <?php require_once __DIR__ . '/../vendor/autoload.php'; use \InitPHP\Console\{Application, Input, Output}; $console = new Application("My Console Application", '1.0'); // Register commands ... // hello -name=John $console->register('hello', function (Input $input, Output $output) { if ($input->hasArgument('name')) { $output->writeln('Hello {name}', [ 'name' => $input->getArgument('name') ]); } else { $output->writeln('Hello World!'); } }, 'Says hello.'); $console->run();
php console.php list
Credits
License
Copyright © 2022 MIT License
统计信息
- 总下载量: 104
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-06