Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
SessionManagerFactory Class Reference

Public Member Functions

 __invoke (ContainerInterface $container, $requestedName, array $options=null)
 Create session manager object (v3 usage).
 
 createService (ServiceLocatorInterface $services, $canonicalName=null, $requestedName=SessionManager::class)
 Create a SessionManager instance (v2 usage)
 
- Public Member Functions inherited from FactoryInterface
 createService (ServiceLocatorInterface $serviceLocator)
 Create service.
 

Protected Attributes

 $defaultManagerConfig
 

Member Function Documentation

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

Create session manager object (v3 usage).

Will consume any combination (or zero) of the following services, when present, to construct the SessionManager instance:

The first two have corresponding factories inside this namespace. The last, however, does not, due to the differences in implementations, and the fact that save handlers will often be written in userland. As such if you wish to attach a save handler to the manager, you will need to write your own factory, and assign it to the service name "Zend\Session\SaveHandler\SaveHandlerInterface", (or alias that name to your own service).

You can configure limited behaviors via the "session_manager" key of the Config service. Currently, these include:

  • enable_default_container_manager: whether to inject the created instance as the default manager for Container instances. The default value for this is true; set it to false to disable.
  • validators: ...
Parameters
ContainerInterface$container
string$requestedName
array$options
Returns
SessionManager

Implements FactoryInterface.

createService ( ServiceLocatorInterface  $services,
  $canonicalName = null,
  $requestedName = SessionManager::class 
)

Create a SessionManager instance (v2 usage)

Parameters
ServiceLocatorInterface$services
null | string$canonicalName
string$requestedName
Returns
SessionManager

Member Data Documentation

$defaultManagerConfig
protected
Initial value:
= [
'enable_default_container_manager' => true