GetOpt.php
a better getopt for php

View the Project on GitHub getopt-php/getopt-php

Build Status Coverage Status Latest Stable Version Total Downloads Total Downloads

Installation

The recommended way of installing GetOpt.php is to use Composer.

Use composer

$ /path/to/composer require ulrichsg/getopt-php

Replace ^3.0 by the release number you want to use (a list of releases is available on Packagist).

Manually edit composer.json

Add it to your composer.json file like this:

{
    "require": {
        "ulrichsg/getopt-php": "^3.2"
    }
}

Afterwards update the package or all packages:

# update only getopt-php
$ /path/to/composer update ulrichsg/getopt-php

# update all packages
$ /path/to/composer update

Download and install manually

If not using Composer, you can download the desired release from GitHub and integrate it into your application manually. GetOpt.php does not have any external dependencies.

In this case you have to configure an autoload mechanism or load all files manually too.