An static, utility class for interacting with Console environment.

Declared abstract to prevent from instantiating.

 Methods

Pass-thru static call to current AdapterInterface instance.

__callStatic($funcName, $arguments) : mixed

Parameters

$funcName

$arguments

Returns

mixed

Try to detect best matching adapter

detectBestAdapter() : string | null

Returns

stringnull

Create and return Adapter\AdapterInterface instance.

getInstance(null | string $forceAdapter, null | string $forceCharset) : \Zend\Console\Adapter\AdapterInterface

Parameters

$forceAdapter

nullstring

Optional adapter class name. Ccan be absolute namespace or class name relative to Zend\Console\Adapter. If not provided, a best matching adapter will be automatically selected.

$forceCharset

nullstring

optional charset name can be absolute namespace or class name relative to Zend\Console\Charset. If not provided, charset will be detected automatically.

Exceptions

\Zend\Console\Exception\InvalidArgumentException
\Zend\Console\Exception\RuntimeException

Returns

Check if running under MS Windows Ansicon

isAnsicon() : bool

Returns

bool

Check if running in a console environment (CLI)

isConsole() : bool

By default, returns value of PHP_SAPI global constant. If $isConsole is set, and a boolean value, that value will be returned.

Returns

bool

Check if currently running under MS Windows

isWindows() : bool

see \Zend\Console\http://stackoverflow.com/questions/738823/possible-values-for-php-os

Returns

bool

Override the "is console environment" flag

overrideIsConsole(null | bool $flag) 

Parameters

$flag

nullbool

Reset the console instance

resetInstance() 

 Properties

 

$instance

$instance : \Zend\Console\Adapter\AdapterInterface

 

Allow overriding whether or not we're in a console env.

$isConsole : bool

If set, and boolean, returns that value from isConsole().