Download the PHP package php-pmd/console without Composer

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

Console

Console based on Clio.

Console is a lightweight utility and helper classes for CLI applications.

It provides colored output, prompts, confirmation inputs, selections, background.

Installation

PHP 5.4 is required. This library is developed on and is meant to be used on POSIX systems with the posix, pcntl, and sockets extensions loaded.

The Console class provides helpers for interactive command line input/output.

Console::stdin($raw = false)

Waits for user input. If $raw is set to true, returns the input without right trimming for PHP_EOL.

Console::input($prompt = null, $raw = false)

Asks the user for input which ends when the user types a PHP_EOL character. You can optionally provide a prompt string. If $raw is set to true, returns the input without right trimming for PHP_EOL.

Console::stdout($text, $raw = false)

Prints $text to STDOUT. The text can contain text color and style specifiers. This method detects whether the text is to be sent out to TTY or to a file through the use of shell redirection and acts accordingly, in the case of the latter, by stripping the text of all color and style specifiers.

If the second parameter is set to true, then it will print $text as is with all text color and style specifiers intact regardless of whether it's printing to TTY or to a file.

Console::output($text, $raw = false)

The same as Console::stdout except it automatically appends a PHP_EOL.

Console::stderr($text, $raw = false)

Behaves like Console::stdout except it's for STDERR.

Console::error($text, $raw = false)

The same as Console::stderr except it automatically appends a PHP_EOL.

Console::prompt($text, $options)

This function prompts the user for input. Several options are available:

If an input error occurs, the prompt will repeat and will keep asking the user for input until it satisfies all the requirements in the $options array. Note that if you supply a default option, required is not enforced.

If you provide your own validator callable, you can pass a custom error message to the second parameter:

Note that for this to work, the second parameter must be declared a reference.

Console::confirm($text)

Asks the user for a simple y/n answer. The answer can be 'y', 'n', 'Y', or 'N'. Returns either true or false.

Console::select($text, $options)

Asks the user to choose from a selection of options. The $options array is a key-value pairs of input and explanation. The '?' input option is appended automatically and it serves as the help option showing all other options along with their respective explanations.

Console::work(callable $callable)

Forks another process to run $callable in the background while showing status updates to the standard output. By default the status update is a simple spinner which will stop once the $callable returns. By providing $callable with a $socket parameter, the status update is whatever is sent from the background process to the foreground process using the socket_write() function:

Messages sent to the foreground process needs to end with a "\n" character.

Text color and style specifiers

You can use text color and style specifiers in the format of %x where x is the specifier:

The %n specifier normalizes the color and style of the text to that of the shell's defaults. This specifier is taken from PEAR's Console_Color package. To print a percentage symbol, simply put two % characters. The following is the full set of specifiers:

You can use these specifiers with methods that takes a string and outputs it.


All versions of console with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-pcntl Version *
ext-posix Version *
ext-sockets Version *
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 php-pmd/console contains the following files

Loading the files please wait ....