gabrieljmj/writeln 问题修复 & 功能扩展

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

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

gabrieljmj/writeln

Composer 安装命令:

composer require gabrieljmj/writeln

包简介

Fast and simple Symfony Console command creation

README 文档

README

Build Status License Latest Unstable Version Total Downloads Scrutinizer Code Quality

Fast and simple Symfony Console command creation

Usage example

#!/usr/bin/env php
<?php
require 'vendor/autoload.php';

use Gabrieljmj\Wwriteln\Wwriteln;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

$cl = new Writeln();
$cl->command('hello',
[
    $cl->argument('name', InputArgument::REQUIRED, 'Your name')
],
[
    $cl->option('uppercase', 'u', InputOption::VALUE_NONE)
],
function (InputInterface $input, OutputInterface $output) {
    $txt = $input->getOption('uppercase') ? strtoupper('Hello ' . $input->getArgument('name')) 
      : 'Hello ' . $input->getArgument('name');
    $output->writeln($txt);
});

$cl->run();
$ bin hello Gabriel
Hello Gabriel

$ bin hello Gabriel -u
HELLO GABRIEL

统计信息

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

GitHub 信息

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

其他信息

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