netfocusinc/argh 问题修复 & 功能扩展

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

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

netfocusinc/argh

Composer 安装命令:

composer require netfocusinc/argh

包简介

Argh! PHP Argument Helper. Easily parse all types of command line arguments in PHP CLI scripts.

README 文档

README

"Argh" is short for Argument Helper.

Interpret PHP command line arguments with ease so you can focus on your CLI application.

Scrutinizer Code Quality

Build Status

System Requirements

This project has been developed and tested with the following (see list below), and has yet to be tested using other operating systems or versions of PHP.

  • PHP 7.2.14
  • CentOS 7.6

Installing

There are two methods of installing Argh. Composer is recommended.

  1. Composer
  2. Phar (PHP Archive)

More detailed instructions can be found at Argh Installation Instructions

Composer Installation

Composer is the preferred method for installation.

$ composer require netfocusinc/argh

$ php vendor/netfocusinc/argh/bin/argh.php about
Argh! by Benjamin Hough, Net Focus Inc. - https://www.netfocusinc.com/argh

Phar (PHP Archive)

Releases can be downloaded from Argh's Github Releases.

$ cd path/to/argh
$ php argh.phar about
Argh! by Benjamin Hough, Net Focus Inc. - https://www.netfocusinc.com/argh

Basic Usage

Using Argh is an easy way to interpret command line arguments in your PHP CLI scripts.

When your PHP CLI script is invoked with command line arguments $ php myprogram.php --message='Hello World!'

<?php

include 'vendor/autoload.php';

use netfocusinc\argh\Argh;
use netfocusinc\argh\StringParameter;

// Create a new Argh instance
$argh = new Argh(
  [
    StringParameter::createWithAttributes( [ 'name' => 'message' ] )		
  ]
);

// Let Argh parse PHP's $argv array
$argh->parse($argv);

// Access run-time values of the arguments that were supplied to your CLI script
echo $argh->message; // Hello World!

See more examples of how to use Argh are available.

Running Unit Tests

The PHPUnit tests for Argh can be run like this.

$ vendor/bin/phpunit --bootstrap vendor/autoload.php --testdox tests/

Built With

  • PHP - PHP is a popular general-purpose scripting language that is especially suited to web development.
  • Composer - Dependency Manager for PHP
  • PHPUnit - Testing Framework
  • phar-composer - Simple phar creation for any project managed via composer.

Versioning

This project uses Semantic Versioning

For the versions available, see the GitHub releases page.

A Changelog is also available on Github.

Authors

See the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固