Download the PHP package eureka/component-console without Composer
On this page you can find all versions of the php package eureka/component-console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eureka/component-console
More information about eureka/component-console
Files in eureka/component-console
Package component-console
Short Description Component console to run script with Eureka Framework
License MIT
Informations about the package component-console
Component Console (formerly Eurekon)
Console component to run script. You can integrate it easily in Eureka Framework application with Kernel Console, and use dependency injection.
Console provide argument manager (like every another command on linux system). Console have some defined classes to help you to do a lot of beautiful script.
Execution
Documentation
Options & Arguments
The options work like unix arguments. Full & short alias are supported.
So, you can have dynamics script based on command options.
Reserved Options
Some options are reserved:
-h
,--help
: Display Help--no-color
: Disable colors / styling (Can also be disabled with NO_COLOR env var)--debug
: Activate debug mode (trace on exception if script is terminated with an exception)--time-limit=ARG
: Specified time limit in seconds (default: 0 - unlimited)--memory-limit=ARG
: Specified memory limit (128M, 1024M, 4G... - default: 256M)--error-reporting=ARG
: Specified value for error-reporting (default: -1 - all)--error-display=ARG
: Specified value for display_errors setting. Values: 0|1 Default: 1 (display)--quiet
: Force disabled console output (if message are written on stream output)--with-header
: Enable console lib message header--with-footer
: Enable console lib messages footer--script=ARG
(or justARG
): Console class script to run (Example: database/console) - MANDATORY
Help
Class help is provided to have a pretty format of parameters when you use --help
arguments for your script.
Input / Output
Input
Input is handle by Input interface. Can handle prompt console from user.
Output
Output is handle by Output interface. Can display content on standard output, file, memory (depending the stream resource passed to the OutputStream class).
Styling
Console output support styling and color:
Colors
Console now embed 4 bits colors, 8 bits colors & 24 bits colors. Support of 8 bit & 24 bits colors depends on terminal application (8 bit color have correct support, not 24 bits)
- 4 bits color are listed in two Enum to facilitate manipulation (for regular & high intensity color)
- 8 bits base colors are listed in two Enum (for regular & high intensity color)
- 8 bits complex color use RGB class (+ greyscale class with intensity)
- 24 bits use RGB class
Pretty table
You can easily display a pretty table with Table & related classes:
The output will be:
And with non-extended ascii chars:
Pretty progress bar / %
You can easily display a progress bar or percentage:
Type bar
After the first iteration:
After the second iteration:
At the end:
Type percent
After the first iteration:
After the second iteration:
At the end:
Terminal & Cursor
Now, you can get a terminal to have information about width / height of terminal, and manipulate cursor on this
Contributing
See the CONTRIBUTING file.
Install / update project
You can install project with the following command:
And update with the following command:
NB: For the components, the composer.lock
file is not committed.
Testing & CI (Continuous Integration)
Tests
You can run tests (with coverage) on your side with following command:
For prettier output (but without coverage), you can use the following command:
Code Style
You also can run code style check with following commands:
You also can run code style fixes with following commands:
Static Analysis
To perform a static analyze of your code (with phpstan, lvl 9 at default), you can use the following command:
To ensure you code still compatible with current supported version at Deezer and futures versions of php, you need to run the following commands (both are required for full support):
Minimal supported version:
Maximal supported version:
CI Simulation
And the last "helper" commands, you can run before commit and push, is:
License
component-console is licensed under the MIT License - see the LICENSE
file for details
All versions of component-console with dependencies
ext-mbstring Version *
lcobucci/clock Version ^2.3||^3.0
psr/clock Version ^1.0
psr/container Version ^1.0||^2.0
psr/log Version ^1.1||^2.0||^3.0