\Cake\ConsoleConsoleInput

Object wrapper for interacting with stdin

Summary

Methods
Properties
Constants
__construct()
read()
dataAvailable()
No public properties found
No constants found
No protected methods found
$_input
$_canReadline
N/A
No private methods found
No private properties found
N/A

Properties

$_input

$_input : resource

Input value.

Type

resource

$_canReadline

$_canReadline : boolean

Can this instance use readline? Two conditions must be met: 1. Readline support must be enabled.

  1. Handle we are attached to must be stdin. Allows rich editing with arrow keys and history when inputting a string.

Type

boolean

Methods

__construct()

__construct(string  $handle = 'php://stdin') 

Constructor

Parameters

string $handle

The location of the stream to use as input.

read()

read() : mixed

Read a value from the stream

Returns

mixed —

The value of the stream

dataAvailable()

dataAvailable(integer  $timeout) : boolean

Check if data is available on stdin

Parameters

integer $timeout

An optional time to wait for data

Returns

boolean —

True for data available, false otherwise