2017 © Pedro Peláez
 

library php-argv

PHP CLI arguments parse.

image

samejack/php-argv

PHP CLI arguments parse.

  • Thursday, April 14, 2016
  • by samejack
  • Repository
  • 1 Watchers
  • 4 Stars
  • 294 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

php-argv

Latest Stable Version Build Status Coverage Status License, (*1)

PHP CLI (command-line interface) argurments parser. PHP-Argv can parse rich pattern, such as the follows, (*2)

Install by composer

composer require samejack/php-argv

CLI Example

$ ./example/bin-cli -h 127.0.0.1 -u=user -p passwd --debug --max-size=3 test
Array
(
    [h] => 127.0.0.1
    [u] => user
    [p] => passwd
    [debug] => 1
    [max-size] => 3
    [test] => 1
)

PHP Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$argvParser = new \samejack\PHP\ArgvParser();

$string = '-h 127.0.0.1 -u=user -p passwd --debug --max-size=3 test';

print_r($argvParser->parseConfigs($string));

Output:, (*3)

Array
(
    [h] => 127.0.0.1
    [u] => user
    [p] => passwd
    [debug] => 1
    [max-size] => 3
    [test] => 1
)

License

Apache License 2.0, (*4)

The Versions

14/04 2016

dev-master

9999999-dev https://github.com/samejack/php-argv

PHP CLI arguments parse.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

by SJ

php cli

13/04 2016

1.0.0

1.0.0.0 https://github.com/samejack/php-argv

PHP CLI arguments parse.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

by SJ

php cli