Download the PHP package packfire/options without Composer
On this page you can find all versions of the php package packfire/options. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download packfire/options
More information about packfire/options
Files in packfire/options
Download packfire/options
More information about packfire/options
Files in packfire/options
Vendor packfire
Package options
Short Description Better CLI argument processing in PHP
License BSD-3-Clause
Homepage http://mauris.sg/packfire/
Package options
Short Description Better CLI argument processing in PHP
License BSD-3-Clause
Homepage http://mauris.sg/packfire/
Please rate this library. Is it a good library?
Informations about the package options
Packfire Options
Better CLI argument processing in PHP
Options helps you to parse CLI arguments using callbacks and Closures (in PHP 5.3+) effectively. Implementing the NDesk.Options (C#) in PHP, you will be able to write neat CLI applications in PHP quickly.
Requirements
-
= PHP 5.3
Installation
To install Packfire Options, add the entry to your composer.json
"require" section:
"packfire/options": "1.1.*"
Usage
use Packfire\Options\OptionSet;
$command = null;
$quiet = false;
$force = false;
$linker = false;
$file = '';
$options = new OptionSet();
$options->addIndex(0, function($value) use(&$command) {
$command = $value;
});
$options->add('q', function() use(&$quiet) {
$quiet = true;
});
$options->add('l', function() use(&$linker) {
$linker = true;
});
$options->add('f', function() use(&$force) {
$force = true;
});
$options->add('file=', function($value) use(&$file) {
$file = $value;
});
$options->parse($_SERVER['argv']);
Projects using Packfire Options
Contributors
- Sam-Mauris Yong (@thephpdeveloper)
License
Packfire Options is licensed under the BSD 3-Clause License. See license file in repository for details.
All versions of options with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.0
The package packfire/options contains the following files
Loading the files please wait ....