Download the PHP package kentaro-a/phpcommander without Composer

On this page you can find all versions of the php package kentaro-a/phpcommander. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpcommander

PHPCommander

Easy to handle flags and options which passed through by $argv. Flags and options have to be start with "-" or "--". If you've already have any classes and you'd like to make something like CLI batches with it, PHPCommander makes it easy.

Requirements

Install

How To Use

Make Flags for command

Use new Flg(string $flg, bool $must=false, string $help="", array $validators=[]) to make Flag. you can make custom validator class like preset validator ValidatorNotEmptyString.

param desc
$flg require, this must start with - or --
$must optional default=false, if true check for being passed flg in cli args.
$help optional default="", help text to be shown.
$validators optional default=[], an array of sub classes of Validator to validate flg.

You can make Procedure which implements ProcedureInterface.

Make Command

After making Procedure you can set it into Command. Using new Command(string $command_name, ProcedureInterface $procedure, Flgs $flgs=null, string $description="").

param desc
$command_name require, this must not start with - or --
$procedure require, procedure to be called when command passed.
$flgs optional default=null, Flgs class contains an array of Flg classes.
$description optional default="", description text to be shown in help.

Add Commands into Commander and invoke registered command.

Commander::invoke obtains command name and options from $argv then invokes relevant Procedure::__invoke().

Show help.

You can show registered command list without any parameters.

You can also pass the reserved flg after command_name like -h or --help to show help.

Detail

See examples.


All versions of phpcommander with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kentaro-a/phpcommander contains the following files

Loading the files please wait ....