Download the PHP package lupecode/console without Composer

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

What is it?

This library is a console helper for ANSI colors, progress bars, and tables.

If you have a console that is not Windows command prompt, and you can have color in your console, this library will help you jazz up your PHP console applications.

Requirements

This library requires PHP >= 7.0.

Readline

If you wish to use Console::readline, Console::promptReadline, or Console::optionsReadline you will need to have the readline module loaded in PHP. On Windows, this requires PHP >= 7.1.0

Installation

The best way to install this console helper is to use Composer.

composer require lupecode/console

How To

tl;dr

See the tests folder.

Basic Print

Console::print('Hello World'); // Will not print a new line at the end
Console::printLine('Hello World'); // Will print a new line at the end

Built-in Styles

Console has a few built-in styles.

Console::printHeader('Header Message'); // Prints the text in a yellow box
Console::printDebug('Debug Message'); // Prints the text in a gray color
Console::printError('Error Message'); // Prints the text in a red color
Console::printStatus('Status Message'); // Prints the text in a blue color
Console::printSuccess('Success Message'); // Prints the text in a green color

16 Color Palette

Console has support for 16 color palette.

$color = new Color16();
$color
    ->setBackgroundColor(Color::YELLOW)
    ->setForegroundColor(Color::BLACK)
    ->setFlag(Color::BOLD)
;
Console::printLine('Print Line In Color', $color);

256 Color Palette

Console has support for 256 color palette. These colors range with RGB from 0 to 5 for 216 colors. There are 24 levels of grayscale.

$color = new Color256();
$color
    ->setBackgroundColor(5,5,0)
    ->setForegroundColorGrayscale(0)
    ->setFlag(Color::BOLD)
;
Console::printLine('Print Line In Color', $color);

Progress Bars

Console has support for progress bars.

$pBar = Console::progressBar();
$pBar->setBarSize(30)->setTotal(100)->startTimer();
for ($i = 0; $i < 100; $i++) {
    $pBar->increment();
}
$pBar->finish();

Tables

Console has support for tables.

Console::table()
   ->addColumn('ID')
   ->addColumn('Title')
   ->addColumn('ISBN')
   ->addRow([1, 'Lorem Ipsum and the Valley of Goblins', '987-12345678-1'])
   ->addRow([2, 'Lorem Ipsum and the Chair of Sadness', '987-12345678-2'])
   ->addRow([3, 'Lorem Ipsum and the Sands of Itchiness', '987-12345678-3'])
   ->addRow([4, 'Lorem Ipsum and the Lingua Franca', '987-12345678-4'])
   ->printTable()
;

All versions of console with dependencies

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

Loading the files please wait ....