我正在将从ZF2开发的模块移植到ZF3 .

在ZF2中,我可以像这样注入SessionManager

'Zend\Session\SessionManager' => 'Core\Session\Factory\SessionManagerFactory'

在ZF3中,如果我执行相同的SessionManager,它永远不会通过Factory配置,并且从不调用工厂本身 .

\Zend\Session\SessionManager::class => \Core\Session\Factory\SessionManagerFactory::class

为什么?

我发现工作的唯一方法是注入ManagerInterface . 我想知道并理解这是否正确 .

\Zend\Session\ManagerInterface::class           => \Core\Session\Factory\SessionManagerFactory::class,