TYPO3  7.6
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Shell Class Reference

Public Member Functions

 __construct (Application $application)
 
 run ()
 
 getProcessIsolation ()
 
 setProcessIsolation ($processIsolation)
 

Protected Member Functions

 getHeader ()
 
 getPrompt ()
 
 getOutput ()
 
 getApplication ()
 

Private Member Functions

 autocompleter ($text)
 
 readline ()
 

Private Attributes

 $application
 
 $history
 
 $output
 
 $hasReadline
 
 $processIsolation = false
 

Detailed Description

A Shell wraps an Application to add shell capabilities to it.

Support for history and completion only works with a PHP compiled with readline support (either –with-readline or –with-libedit)

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Martin HasoĊˆ marti.nosp@m.n.ha.nosp@m.son@g.nosp@m.mail.nosp@m..com

Definition at line 28 of file console/Shell.php.

Constructor & Destructor Documentation

__construct ( Application  $application)

Constructor.

If there is no readline support for the current PHP executable a exception is thrown.

Parameters
Application$applicationAn application instance

Definition at line 44 of file console/Shell.php.

References Shell\$application, and Application\getName().

Member Function Documentation

autocompleter (   $text)
private

Tries to return autocompletion for the current entered text.

Parameters
string$textThe last segment of the entered text
Returns
bool|array A list of guessed strings or true

Definition at line 168 of file console/Shell.php.

getApplication ( )
protected

Definition at line 156 of file console/Shell.php.

getHeader ( )
protected

Returns the shell header.

Returns
string The header string

Definition at line 126 of file console/Shell.php.

Referenced by Shell\run().

getOutput ( )
protected

Definition at line 151 of file console/Shell.php.

getProcessIsolation ( )

Definition at line 215 of file console/Shell.php.

getPrompt ( )
protected

Renders a prompt.

Returns
string The prompt

Definition at line 145 of file console/Shell.php.

readline ( )
private

Reads a single line from standard input.

Returns
string The single line from standard input

Definition at line 202 of file console/Shell.php.

run ( )

Runs the shell.

Definition at line 55 of file console/Shell.php.

References Shell\getHeader().

setProcessIsolation (   $processIsolation)

Definition at line 220 of file console/Shell.php.

Member Data Documentation

$application
private

Definition at line 30 of file console/Shell.php.

Referenced by Shell\__construct().

$hasReadline
private

Definition at line 33 of file console/Shell.php.

$history
private

Definition at line 31 of file console/Shell.php.

$output
private

Definition at line 32 of file console/Shell.php.

$processIsolation = false
private

Definition at line 34 of file console/Shell.php.