Zend Framework  2.4
Static Public Member Functions | Static Protected Attributes | List of all members
Console Class Reference

A static, utility class for interacting with Console environment. More...

Static Public Member Functions

static getInstance ($forceAdapter=null, $forceCharset=null)
 Create and return Adapter instance.
 
static resetInstance ()
 Reset the console instance.
 
static isWindows ()
 Check if currently running under MS Windows.
 
static isAnsicon ()
 Check if running under MS Windows Ansicon.
 
static isConsole ()
 Check if running in a console environment (CLI)
 
static overrideIsConsole ($flag)
 Override the "is console environment" flag.
 
static detectBestAdapter ()
 Try to detect best matching adapter.
 
static __callStatic ($funcName, $arguments)
 Pass-thru static call to current AdapterInterface instance.
 

Static Protected Attributes

static $instance
 
static $isConsole
 

Detailed Description

A static, utility class for interacting with Console environment.

Declared abstract to prevent from instantiating.

Member Function Documentation

static __callStatic (   $funcName,
  $arguments 
)
static

Pass-thru static call to current AdapterInterface instance.

Parameters
$funcName
$arguments
Returns
mixed
static detectBestAdapter ( )
static

Try to detect best matching adapter.

Returns
string|null
static getInstance (   $forceAdapter = null,
  $forceCharset = null 
)
static

Create and return Adapter instance.

Parameters
null | string$forceAdapterOptional adapter class name. Can be absolute namespace or class name relative to Zend If not provided, a best matching adapter will be automatically selected.
null | string$forceCharsetoptional charset name can be absolute namespace or class name relative to Zend If not provided, charset will be detected automatically.
Exceptions
Exception\InvalidArgumentException
Exception\RuntimeException
Returns
Adapter
static isAnsicon ( )
static

Check if running under MS Windows Ansicon.

Returns
bool
static isConsole ( )
static

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.

Returns
bool
static isWindows ( )
static

Check if currently running under MS Windows.

See Also
http://stackoverflow.com/questions/738823/possible-values-for-php-os
Returns
bool
static overrideIsConsole (   $flag)
static

Override the "is console environment" flag.

Parameters
null | bool$flag
static resetInstance ( )
static

Reset the console instance.

Member Data Documentation

$instance
staticprotected
$isConsole
staticprotected