99
1010namespace Zend \Session \Service ;
1111
12+ use Interop \Container \ContainerInterface ;
1213use Zend \ServiceManager \Exception \ServiceNotCreatedException ;
13- use Zend \ServiceManager \FactoryInterface ;
14- use Zend \ServiceManager \ServiceLocatorInterface ;
14+ use Zend \ServiceManager \Factory \FactoryInterface ;
1515use Zend \Session \Config \ConfigInterface ;
1616use Zend \Session \Container ;
1717use Zend \Session \SaveHandler \SaveHandlerInterface ;
@@ -55,21 +55,21 @@ class SessionManagerFactory implements FactoryInterface
5555 * this is true; set it to false to disable.
5656 * - validators: ...
5757 *
58- * @param ServiceLocatorInterface $services
58+ * @param ContainerInterface $container
59+ * @param string $requestedName
60+ * @param array $options
5961 * @return SessionManager
60- * @throws ServiceNotCreatedException if any collaborators are not of the
61- * correct type
6262 */
63- public function createService ( ServiceLocatorInterface $ services )
63+ public function __invoke ( ContainerInterface $ container , $ requestedName , array $ options = null )
6464 {
6565 $ config = null ;
6666 $ storage = null ;
6767 $ saveHandler = null ;
6868 $ validators = [];
6969 $ managerConfig = $ this ->defaultManagerConfig ;
7070
71- if ($ services ->has ('Zend\Session\Config\ConfigInterface ' )) {
72- $ config = $ services ->get ('Zend\Session\Config\ConfigInterface ' );
71+ if ($ container ->has ('Zend\Session\Config\ConfigInterface ' )) {
72+ $ config = $ container ->get ('Zend\Session\Config\ConfigInterface ' );
7373 if (!$ config instanceof ConfigInterface) {
7474 throw new ServiceNotCreatedException (sprintf (
7575 'SessionManager requires that the %s service implement %s; received "%s" ' ,
@@ -80,8 +80,8 @@ public function createService(ServiceLocatorInterface $services)
8080 }
8181 }
8282
83- if ($ services ->has ('Zend\Session\Storage\StorageInterface ' )) {
84- $ storage = $ services ->get ('Zend\Session\Storage\StorageInterface ' );
83+ if ($ container ->has ('Zend\Session\Storage\StorageInterface ' )) {
84+ $ storage = $ container ->get ('Zend\Session\Storage\StorageInterface ' );
8585 if (!$ storage instanceof StorageInterface) {
8686 throw new ServiceNotCreatedException (sprintf (
8787 'SessionManager requires that the %s service implement %s; received "%s" ' ,
@@ -92,8 +92,8 @@ public function createService(ServiceLocatorInterface $services)
9292 }
9393 }
9494
95- if ($ services ->has ('Zend\Session\SaveHandler\SaveHandlerInterface ' )) {
96- $ saveHandler = $ services ->get ('Zend\Session\SaveHandler\SaveHandlerInterface ' );
95+ if ($ container ->has ('Zend\Session\SaveHandler\SaveHandlerInterface ' )) {
96+ $ saveHandler = $ container ->get ('Zend\Session\SaveHandler\SaveHandlerInterface ' );
9797 if (!$ saveHandler instanceof SaveHandlerInterface) {
9898 throw new ServiceNotCreatedException (sprintf (
9999 'SessionManager requires that the %s service implement %s; received "%s" ' ,
@@ -105,8 +105,8 @@ public function createService(ServiceLocatorInterface $services)
105105 }
106106
107107 // Get session manager configuration, if any, and merge with default configuration
108- if ($ services ->has ('Config ' )) {
109- $ configService = $ services ->get ('Config ' );
108+ if ($ container ->has ('config ' )) {
109+ $ configService = $ container ->get ('config ' );
110110 if (isset ($ configService ['session_manager ' ])
111111 && is_array ($ configService ['session_manager ' ])
112112 ) {
0 commit comments