Download the PHP package ncuesta/clinner without Composer

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

Clinner

Build Status

Clinner is a PHP 5.3+ Command-Line Interface commands execution abstraction.

Advantages

Clinner has the following benefits:

Usage

Simple usage

The most basic use of Clinner consists of installing it as a dependency via Composer and then including Composer's autoloader.php in your code:

  1. Create (if needed) a composer.json file or add an entry to your existing one:

  2. Include Composer's autoload.php file on your code:

  3. Start using commands right away!

Passing arguments

Commands crave for arguments, so Clinner offers a way to satisfying them. By passing in a second argument to the factory method or the constructor, or using the dedicated setter method setArguments().

Arguments can either be key-value pairs or just values. Key value pairs will be joined using a delimiter (see Options section for more information).

Options

Options allow customization of different Command behaviors. They can be passed in as a third argument for the factory method or constructor, or set via the setOptions() method.

Currently there's only one thing that can be customized for the Command class, but it's worth noting it: you might specify the delimiter, a string that will be used to join key-value pairs of arguments. If not specified, it will default to the equals sign (=).

Let's see an example:

Advanced usage: Commands pipes

Commands can be piped just like in any Unix shell. The basics of command pipes is that the output of a command is sent to the one that is piped to it.

For example, if you want to run ls -a | grep -i clinner, you can:

Command pipes are not limited to a number of commands, you only need at least two commands.

See next section for a more complex example involving 3 commands in a pipeline.

Advanced usage: Mixing PHP with commands

Apart from Command class, Clinner ships with a Callback command class that enables to mix both commands and PHP code in a command pipe. Pretty cool, huh?

Callback class only takes a Closure or a function reference in its constructor and then is ready to run. That Closure function will receive the command's input as its first argument and is expected to return an exit code. Any information output by the function (either via echo or print or any other output method) will be considered as the command output and will be sent to the next command in the pipe, if any.

Creating commands from string

As of 0.1.2 it is possible to create a Command instance from a string, using the command as if you had written it in a CLI.

For instance, the following command could be run on the CLI:

Would output all the lines in the /etc/hosts file that contain the string localhost with any tab (\t) indent replaced by a single blank space ( ).

This very same command can be passed as a string to \Clinner\Command\Command::fromString() and a new Command instance representing this commands chain will be returned:

And then you can work with the newly created Command instance as usual, and pipe other Commands or even Callbacks to it.

Requirements

The only requirement for Clinner is PHP version >= 5.3.

Contributing

Please, feel free to fork this repo and improve it in any way you consider useful -- Pull Requests are welcome!


All versions of clinner with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
symfony/class-loader Version ~2.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 ncuesta/clinner contains the following files

Loading the files please wait ....