Zend\Console\Console
A static, utility class for interacting with Console environment.
Declared abstract to prevent from instantiating.
Synopsis
class Console
{
- // members
- protected AdapterInterface $instance;
- protected bool $isConsole;
- // methods
- public static AdapterInterface getInstance()
- public static void resetInstance()
- public static bool isWindows()
- public static bool isAnsicon()
- public static bool isConsole()
- public static void overrideIsConsole()
- public static string|null detectBestAdapter()
- public static mixed __callStatic()
Members
protected
- $instance — Zend\Console\Adapter\AdapterInterface
- $isConsole
—
Zend\Console\bool
Allow overriding whether or not we're in a console env. If set, and boolean, returns that value from isConsole().
Methods
public
- __callStatic() — Pass-thru static call to current AdapterInterface instance.
- detectBestAdapter() — Try to detect best matching adapter
- getInstance() — Create and return Adapter\AdapterInterface instance.
- isAnsicon() — Check if running under MS Windows Ansicon
- isConsole() — Check if running in a console environment (CLI)
- isWindows() — Check if currently running under MS Windows
- overrideIsConsole() — Override the "is console environment" flag
- resetInstance() — Reset the console instance