W3cubDocs

/CakePHP 4.1

Class ConsoleInput

Object wrapper for interacting with stdin

Namespace: Cake\Console

Properties summary

  • $_canReadline protected
    bool

    Can this instance use readline? Two conditions must be met:

    1. Readline support must be enabled.
  • $_input protected
    resource

    Input value.

Method Summary

Method Detail

__construct() public

__construct(string $handle)

Constructor

Parameters

string $handle optional

The location of the stream to use as input.

dataAvailable() public

dataAvailable(int $timeout)

Check if data is available on stdin

Parameters

int $timeout optional

An optional time to wait for data

Returns

bool

True for data available, false otherwise

read() public

read()

Read a value from the stream

Returns

string|null

The value of the stream. Null on EOF.

Property Detail

$_canReadline protected

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

bool

$_input protected

Input value.

Type

resource

© 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/4.1/class-Cake.Console.ConsoleInput.html