PHP Classes

PHP Command Line Shell: Use ncurses to get key inputs and write shell text

Recommend this page to a friend!
  Info   Videos Videos   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 347 All time: 7,012 This week: 101Up
Version License PHP version Categories
kmd 0.1Public Domain4Console


This class can use ncurses to get key inputs and write text to the command line shell.

It can initialized the ncurses extension to use the current shell optionally using a given shell history file and outputting a given screen file.

The class provides functions to move the position of the cursor and display text on the screen.

Sub-classes may extend the base class to define how to handle the use of certain keys like return, tab or escape, so sub-classes can define the output to display the screen as result of actions triggered by those keys.

Innovation Award
PHP Programming Innovation award winner
August 2013

Prize: One subscription to the PDF edition of the PHP Architect magazine
Command line shell applications often use the ncurses extension to read the user input and format the output to the shell terminal.

This class can help developing ncurses based applications by providing means to define how to interact with the user when he uses common keys like return, tab, escape and the cursor keys.

Manuel Lemos
Picture of François NEUMANN-RYSTOW
Name: François NEUMANN-RYSTOW <contact>
Classes: 3 packages by
Country: France France
Age: 43
All time rank: 119340 in France France
Week rank: 364 Up13 in France France Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

  Files folder image Files  
File Role Description
Plain text file kmd.php Class ncurses commandline class
Accessible without login Plain text file sample-kmd-basic.php Example basic sample, just to instanciate the class
Accessible without login Plain text file sample-kmd-php.php Example rewrite of php -a, php interactive shell
Accessible without login Plain text file sample-kmd-shell.php Example wrapping linux console for education or joke purpose.
Accessible without login Plain text file sample-kmd-sybase.php Appl. Microsoft sql server commandline client

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,012
This week:101Up