Download the PHP package blumfontein/command-line-php without Composer

On this page you can find all versions of the php package blumfontein/command-line-php. 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 command-line-php

CommandLine.php

PHP Command Line interface class. Provides friendly and flexible CLI argument parsing.

Usage

$args = CommandLine::parseArgs($_SERVER['argv']);

This command line option parser supports any combination of three types of options [single character options (-a -b or -ab or -c -d=dog or -cd dog), long options (--foo or --bar=baz or --bar baz) and arguments (arg1 arg2)] and returns a simple array.

[pfisher ~]$ php test.php --foo --bar=baz --spam eggs
  ["foo"]   => true
  ["bar"]   => "baz"
  ["spam"]  => "eggs"

[pfisher ~]$ php test.php -abc foo
  ["a"]     => true
  ["b"]     => true
  ["c"]     => "foo"

[pfisher ~]$ php test.php arg1 arg2 arg3
  [0]       => "arg1"
  [1]       => "arg2"
  [2]       => "arg3"

[pfisher ~]$ php test.php plain-arg --foo --bar=baz --funny="spam=eggs" --also-funny=spam=eggs \
> 'plain arg 2' -abc -k=value "plain arg 3" --s="original" --s='overwrite' --s
  [0]       => "plain-arg"
  ["foo"]   => true
  ["bar"]   => "baz"
  ["funny"] => "spam=eggs"
  ["also-funny"]=> "spam=eggs"
  [1]       => "plain arg 2"
  ["a"]     => true
  ["b"]     => true
  ["c"]     => true
  ["k"]     => "value"
  [2]       => "plain arg 3"
  ["s"]     => "overwrite"

Not supported: -cd=dog.

@author Patrick Fisher [email protected]

@since August 21, 2009

@see

Note: parseArgs.php contains a "minified" version of the same code, for your copypasta pleasure. For little scripts for which you want to have a nice interface.


All versions of command-line-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 blumfontein/command-line-php contains the following files

Loading the files please wait ....