承接 net_bazzline/php_component_cli_environment 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

net_bazzline/php_component_cli_environment

最新稳定版本:0.3.1

Composer 安装命令:

composer require net_bazzline/php_component_cli_environment

包简介

free as in freedom command line environment for php creating lean command line executable files

README 文档

README

This project aims to deliver an free as in freedom, easy to use and lean as in fat free environment to create executable command line php files.

This project does not want to be competitive to a big console environment like the once mentioned below in the link section.

The versioneye status is: Dependency Status

The current change log can be found here.

Take a look on openhub.net.

Usage

Create Executable Command Line File

./bin/net_bazzline_create_executable_command_line_file bin/hello

Write Your Code

#open bin/hello
#replace line "$usage			= basename(__FILE__) . ' [-v|--verbose]';" with the line below
$usage			= basename(__FILE__) . ' <your name> [-v|--verbose]';
#replace the line "//put in your business logic" with the code below
//begin of dependencies
$arguments  = $environment->getArguments();
$values     = $arguments->getValues();
//end of dependencies

//begin of argument validation
$valuesNotAreValid = (count($values) == 0);

if ($valuesNotAreValid) {
    throw new InvalidArgumentException(
        'invalid number of arguments provided'
    );
}
//end of argument validation

//begin of business logic
$name = ucfirst($values[0]);

$environment->outputIfVerbosityIsEnabled('provided values are: ' . implode(' ', $values));
$environment->output('Hello ' . $name);
//end of business logic

#execute ./bin/hello world

Example

Install

By Hand

mkdir -p vendor/net_bazzline/php_component_cli_environment
cd vendor/net_bazzline/php_component_cli_environment
git clone https://github.com/bazzline/php_component_cli_environment .

With Packagist

composer require net_bazzline/php_component_cli_environment:dev-master

API

API is available at bazzline.net.

Links

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPLv3
  • 更新时间: 2015-10-10