282. Class

282.1. Zend\Console\Console

An static, utility class for interacting with Console environment. Declared abstract to prevent from instantiating.

282.1.1. Methods

282.1.1.1. getInstance

getInstance()

Create and return AdapterAdapterInterface instance.

Parameters:
  • null|string – Optional adapter class name. Ccan be absolute namespace or class name relative to ZendConsoleAdapter. If not provided, a best matching adapter will be automatically selected.
  • null|string – optional charset name can be absolute namespace or class name relative to ZendConsoleCharset. If not provided, charset will be detected automatically.
Throws ExceptionInvalidArgumentException:
 
Throws ExceptionRuntimeException:
 
Return type:

AdapterAdapterInterface

282.1.1.2. isWindows

isWindows()

Check if currently running under MS Windows

Return type:bool

282.1.1.3. isAnsicon

isAnsicon()

Check if running under MS Windows Ansicon

Return type:bool

282.1.1.4. isConsole

isConsole()

Check if running in a console environment (CLI)

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

Return type:bool

282.1.1.5. overrideIsConsole

overrideIsConsole()

Override the “is console environment” flag

Parameters:null|bool

282.1.1.6. detectBestAdapter

detectBestAdapter()

Try to detect best matching adapter

Return type:string|null

282.1.1.7. __callStatic

__callStatic()

Pass-thru static call to current AdapterInterface instance.

Parameters:
  • $funcName
  • $arguments
Return type:

mixed