gnugat/konzolo 问题修复 & 功能扩展

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

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

gnugat/konzolo

最新稳定版本:v1.1.1

Composer 安装命令:

composer require gnugat/konzolo

包简介

Lightweight Console library, for PHP

README 文档

README

A lightweight Console library, for PHP.

It can be used to build minimalistic CLI applications, or to implement the Command design pattern.

Installation

Use Composer to install Konzolo:

composer require gnugat/konzolo:~1.1

Example

Create a command:

<?php

namespace Acme\Demo\Command;

use Gnugat\Konzolo\Command;
use Gnugat\Konzolo\Input;

class HelloWorldCommand implements Command
{
    public function execute(Input $input)
    {
        $name = $input->getArgument('name');
        echo "Hello $name\n";

        return Command::EXIT_SUCCESS;
    }
}

Create an application:

<?php

require __DIR__.'/vendor/autoload.php';

use Acme\Demo\Command\HelloWorldCommand;
use Gnugat\Konzolo\Application;
use Gnugat\Konzolo\Input;

$input = new Input('hello:world');
$input->setArgument('name', $argv[1]);

$app = new Application();
$app->addCommand('hello:world', new HelloWorldCommand());
$exitCode = $app->run($input)

exit($exitCode);

Further documentation

You can see the current and past versions using one of the following:

You can find more documentation at the following links:

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-03