Zend Framework  3.0
Public Member Functions | List of all members
ConsoleAdapterFactory Class Reference

Public Member Functions

 __invoke (ContainerInterface $container, $name, array $options=null)
 Create and return a Console adapter instance.
 
 createService (ServiceLocatorInterface $container)
 Create and return AdapterInterface instance.
 

Member Function Documentation

__invoke ( ContainerInterface  $container,
  $name,
array  $options = null 
)

Create and return a Console adapter instance.

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( 'invokables' => array( 'MyConsoleAdapter' => 'Zend', 'MyConsoleCharset' => 'Zend', ) )

Parameters
ContainerInterface$container
string$name
null | array$options
Returns
AdapterInterface|stdClass

Implements FactoryInterface.

createService ( ServiceLocatorInterface  $container)

Create and return AdapterInterface instance.

For use with zend-servicemanager v2; proxies to __invoke().

Parameters
ServiceLocatorInterface$container
Returns
AdapterInterface|stdClass

Implements FactoryInterface.