Download the PHP package faslatam/consolekit without Composer

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

ConsoleKit

PHP library to create command line utilities.

Example

In cli.php:

In the shell:

hello world!

More examples in example.php

Installation

The easiest way to install ConsoleKit is using Composer with the following requirement:

Alternatively, you can download the archive and add the src/ folder to PHP's include path:

Usage

Options parser

The default options parser parses an argv-like array. Items can be of the form:

When an option has no value, true will be used. If multiple key/value pairs with the same key are specified, the "key" value will be an array containing all the values.
If "--" is detected, all folowing values will be treated as a single argument

Example: the string "-a -bc --longopt --key=value arg1 arg2 -- --any text" will produce the following two arrays:

Creating commands

Any callbacks can be a command. It will receive three parameters: the arguments array, the options array and the console object.

Commands can also be defined as classes. In this case, they must inherit from ConsoleKit\Command and override the execute() method.

The ConsoleKit\Command class offers helper methods, check it out for more info.

Registering commands

Commands need to be registered in the console object using the addCommand() method (or addCommands()).

Notice that in the last example we have provided a second argument which is an alias for a command. As closures have no name, one must be specified.

The command name for functions is the same as the function name with underscores replaced by dashes (ie. my_command becomes my-command).

The command name for command classes is the short class name without the Command suffix and "dashized" (ie. HelloWorldCommand becomes hello-world).

Running

Simply call the run() method of the console object

Automatic help generation

The help command is automatically registered and provides help about available methods based on doc comments.
Check out example.php for example of available tags

Formating text

Colors

The ConsoleKit\Colors::colorize() method provides an easy way to colorize a text. Colors are defined as either a string or an integer (through constants of the Colors class).
Available colors: black, red, green, yellow, blue, magenta, cyan, white.

Foreground colors are also available in a "bold" variant. Suffix the color name with "+bold" or use the OR bit operator with constants.

TextFormater

The ConsoleKit\TextFormater class allows you to format text using the following options:

Options can be defined using setOptions() or as the first parameter of the constructor.

Widgets

Dialog

Used to interact with the user

Box

Wraps text in a box

Produces:

Progress bar

Displays a progress bar


All versions of consolekit with dependencies

PHP Build Version
Package Version
No informations.
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 faslatam/consolekit contains the following files

Loading the files please wait ....