Download the PHP package metashock/jm_console without Composer

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

J@m; Console

ANSI console library for PHP

Installation

To install Jm_Console you can use the PEAR installer or get a tarball and install the files manually.


Using the PEAR installer

If you haven't discovered the metashock pear channel yet you'll have to do it. Also you should issue a channel update:

pear channel-discover metashock.de/pear
pear channel-update metashock

After this you can install Jm_Console. The following command will install the lastest stable version with its dependencies:

pear install -a metashock/Jm_Console

If you want to install a specific version or a beta version you'll have to specify this version on the command line. For example:

pear install -a metashock/Jm_Console-0.3.0

Manually download and install files

Alternatively, you can just download the package from http://www.metashock.de/pear and put into a folder listed in your include_path. Please refer to the php.net documentation of the include_path directive.

Usage


Basics

Before accessing Jm_Console's functions you'll first get an object reference to it. Jm_Console is a singleton class meaning there is just a single reference available. To get the reference call:


Printing output

Jm_Console provides write access to STDOUT and STDERR. Output is done using the following functions:


Terminal colors

The ANSI Terminal standard allows to define a foreground color, a background color and choose a text decoration mode. Jm_Console aims to provide an intuitive access to terminal colors when printing text.

The simplest thing is to just specifiy a foreground color:

or just specify a text decoration:

or specify both a foreground color and a text decoration:

If want to set the background color you'll have to use the prefix bg: in front of the color. Otherwise Jm_Console couldn't make a difference between foreground color and background color:

Table: Available Graphics modes

Colors Text Decorations
  • black
  • red
  • green
  • yellow
  • blue
  • purple
  • cyan
  • white
  • default
  • bold
  • light
  • italic
  • underline
  • blink
  • reverse
  • hidden
  • default

Cursor positioning

ANSI terminals support positioning of the cursor.

It is also possible to store the cursor position and restore it later:

Example


Drawing a progress bar on terminal

API documentation

The API docs can be found here: http://metashock.de/docs/api/Jm/Console/index.xhtml


All versions of jm_console with dependencies

PHP Build Version
Package Version
Requires pear-www.metashock.de/pear 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 metashock/jm_console contains the following files

Loading the files please wait ....