PHP Classes

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

Recommend this page to a friend!
  Info   Videos   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 348 All time: 7,017 This week: 571Up
Version License PHP version Categories
kmd 0.1Public Domain4Console
Description 

Author

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
Winner


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: 44
All time rank: 119340 in France France
Week rank: 180 Up12 in France France Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

  Files folder image Files (5)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:348
This week:0
All time:7,017
This week:571Up