A static, utility class for interacting with Console environment.

Declared abstract to prevent from instantiating.

package Default

 Methods

Pass-thru static call to current AdapterInterface instance.

__callStatic($funcName, $arguments) : mixed
Static

Parameters

$funcName

$arguments

Returns

mixed

Try to detect best matching adapter

detectBestAdapter() : string | null
Static

Returns

stringnull

Create and return Adapter\AdapterInterface instance.

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

Parameters

$forceAdapter

nullstring

Optional adapter class name. Can 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

\Zend\Console\Adapter\AdapterInterface

Check if running under MS Windows Ansicon

isAnsicon() : boolean
Static

Returns

boolean

Check if running in a console environment (CLI)

isConsole() : boolean
Static

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

Returns

boolean

Check if currently running under MS Windows

isWindows() : boolean
Static
see

Returns

boolean

Override the "is console environment" flag

overrideIsConsole(null|boolean $flag) 
Static

Parameters

$flag

nullboolean

Reset the console instance

resetInstance() 
Static

 Properties

 

$instance

$instance : \Zend\Console\Adapter\AdapterInterface

Default

Static
 

Allow overriding whether or not we're in a console env. If set, and boolean, returns that value from isConsole().

$isConsole : boolean

Default

Static