Class ConsoleInput

Object wrapper for interacting with stdin

Namespace: Cake\Console
Location: Console/ConsoleInput.php

Properties summary

  • $_canReadline protected
    boolean

    Can this instance use readline? Two conditions must be met: 1. Readline support must be enabled. 2. Handle we are attached to must be stdin. Allows rich editing with arrow keys and history when inputting a string.

  • $_input protected
    resource
    Input value.

Method Summary

Method Detail

__construct()source public

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

Constructor

Parameters

string $handle optional 'php://stdin'
The location of the stream to use as input.

dataAvailable()source public

dataAvailable( integer $timeout = 0 )

Check if data is available on stdin

Parameters

integer $timeout optional 0
An optional time to wait for data

Returns

boolean
True for data available, false otherwise

read()source public

read( )

Read a value from the stream

Returns

mixed
The value of the stream

Properties detail

$_canReadlinesource

protected boolean

Can this instance use readline? Two conditions must be met: 1. Readline support must be enabled. 2. Handle we are attached to must be stdin. Allows rich editing with arrow keys and history when inputting a string.

$_inputsource

protected resource

Input value.

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.7/class-Cake.Console.ConsoleInput.html