Download the PHP package initphp/console without Composer

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

InitPHP Console

A small, dependency-free helper library for writing console / CLI applications in PHP — command routing, typed arguments, coloured output, interactive questions and a styleable ANSI table renderer.

CI Latest Stable Version Total Downloads PHP Version Require

Starting with 2.1 this package also ships the ANSI table renderer that used to be distributed as the separate initphp/cli-table package (now deprecated). See Migrating from initphp/cli-table.

Features

Requirements

Installation

Quick start

Create an entry script (e.g. console.php):

Run it:

Terminology

This library distinguishes three kinds of tokens that follow the command name:

Token Shape Accessor
Argument --name, --name=value getArgument()
Option -v, -abc, -key=value getOption()
Segment bare value, e.g. migrate getSegment()

Note: here --long tokens are called arguments and -short tokens are called options. This is the opposite of some other frameworks — keep it in mind when porting code.

All scalar values are cast automatically: "true"/"false"/"yes"/"no" → bool, "null" → null, integer/decimal strings → int/float.

Class-based commands

For anything beyond a one-liner, extend Command:

Declared arguments() are validated before execute() runs: missing required arguments or values that do not match the declared type abort the command with an error.

Output

Interactive prompts

Typing exit or quit at any prompt terminates the application.

Rendering tables

Non-string cell values are stringified ([NULL], [TRUE], [FALSE], [ARRAY], [CALLABLE], [RESOURCE], or the class name for objects), columns are auto-sized, and mb_strlen() is used when available so multibyte values align correctly.

Documentation

In-depth, example-driven guides live in docs/:

  1. Getting started
  2. Commands
  3. Input: arguments, options & segments
  4. Typed input arguments
  5. Output & formatting
  6. Interactive questions
  7. Tables
  8. Migrating from initphp/cli-table

Migrating from initphp/cli-table

The standalone initphp/cli-table package has been merged into this one as of 2.1 and is now deprecated.

If your code uses \InitPHP\CLITable\Table, no source changes are required — this package ships a class_alias keeping the old fully-qualified name working. Just switch the dependency:

(initphp/console declares a Composer replace for initphp/cli-table, so the two will never be installed side by side.) When you next touch the code, prefer the canonical namespace:

The alias is a transition aid and may be removed in a future major release. See the migration guide for details.

Testing & quality

Contributing

Contributions are welcome. Please run composer qa before opening a pull request. See the organisation contributing guidelines.

Credits

License

Released under the MIT License. Copyright © 2022 InitPHP.


All versions of console with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
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 initphp/console contains the following files

Loading the files please wait ...