Download the PHP package spydr97/php-cli-table without Composer

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

PHP CLI Table


example branch parameter

This project's functionality was inspired by clitable and was created because I wanted some additional functionality. The code has undergone a full re-write with a bunch of changes to behaviour and functionality

Features

Requirements

Installation

Usage

Basic Usage

For detailed examples and more complex usage please see the scripts in the example folder The bare minimum required to render a table is the following.

Builder Methods

In the absence of proper documentation, (I haven't decided how I want to do that just yet) here are the methods exposed by the CliTableBuilder that can be used to manipulate the resultant table.

Colors

Colors are defined in the \Spydr97\PhpCliTable\TextColorEnum class. The following colors are available

Data

In addition to data fields, each row can have a _color (DataConstants::DATA_COLOR) property which defines the color of the particular row. This can either be of type TextColorEnum or Closure. If a TextColorEnum is used then the color is applied on the whole row. If a Closure is used the color can either be applied to the whole row or to specific fields.

A DataConstants::DATA_COLOR closure is provided two params, $datum and $field which correspond to the current data row item and column field definition respectively. The return type of this closure must be either a TextColorEnum or null.

e.g. This closure sets the color of every column for the particular row to BLUE except the text column which is left as the configured default (i.e. not overridden).

Fields

Fields can have the following properties defined.

Property Name Type Closure Return Type Required FieldConstant
Key String --- true FIELD_KEY
Name String --- false FIELD_NAME
Column Color TextColorEnum
Closure
TextColorEnum
null
false FIELD_COLUMN_COLOR
Header Color TextColorEnum
Closure
TextColorEnum
null
false FIELD_HEADER_COLOR
Formatter Closure String false FIELD_FORMATTER

The closure definitions for the above Closures are as follows:

Please note that the FieldConstants::FIELD_HEADER_COLOR closure only has a single parameter $field.


All versions of php-cli-table with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 spydr97/php-cli-table contains the following files

Loading the files please wait ....