category Zend
package Zend_Mvc
subpackage Service

 Methods

Create and return a Console adapter instance.

createService(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) : \Zend\Console\Adapter\AdapterInterface | \stdClass

In case we're not in a Console environment, return a dummy stdClass object.

In order to disable adapter auto-detection and use a specific adapter (and charset), add the following fields to application configuration, for example:

'console' => array(
    'adapter' => 'MyConsoleAdapter',     // always use this console adapter
    'charset' => 'MyConsoleCharset',     // always use this console charset
 ),
 'service_manager' => array(
     'invocables' => array(
         'MyConsoleAdapter' => 'Zend\Console\Adapter\Windows',
         'MyConsoleCharset' => 'Zend\Console\Charset\DESCG',
     )
 )

Parameters

Returns