ZF2 di 更新到 2.1.0 后的致命错误


ZF2 Di Fatal Error after Update to 2.1.0

将我的 ZF2 Libary 更新到最新版本后,我的应用程序抛出了一个致命错误。在上一个版本1.0.6中,一切正常。我正在寻找错误的源,但我找不到它,我没有任何线索。也许我在模块中的DI注入数组有问题。希望有人知道这里发生了什么:)

当我在模块配置中删除我的孔 DI 设置时......我的应用程序无法正常工作,因为 DI 不起作用,但致命错误消失了。:/

致命错误:

致命错误:未捕获的异常"Zend''Di''Exception''MissingPropertyException",消息"Zend''Mvc''Router''Http''Segment::__construct"中的参数路由缺少实例/对象...''Zend''Di.php:699

我的 DI 模块配置:

    'di'                 => array(
        'definition' => array(
           'class' => array(
                'Application'View'Helper'LastActions'               => array(
                    'setBenutzerMapper' => array(
                        'required' => true
                    ),
                 ),
                 [...]
           )
         )
     ),

谢谢

github上有一个问题,我今天早上遇到了同样的问题:https://github.com/zendframework/zf2/issues/3625

在补丁发布之前,快速修复是将路由器配置从使用长名称(如"Zend''Mvc''Router''Http''Segment")更改为仅使用"分段",如下所示:

'router' => array(
    'routes' => array(
        'restful' => array(
            'type' => 'Segment',
            ...

同样的问题也发生在我身上。我使用 https://github.com/Domi-cc/SmartyModule 的SmartyModule。它在module.config上使用"di".php但我没有看到长名称的路由器配置

'di' => array(
    'instance' => array(
        'alias' => array(
            // entity manager
            'smarty_engine' => 'Smarty',
        ),
        'SmartyModule'View'Renderer'SmartyStrategy' => array(
            'parameters' => array(
                'smarty' => 'SmartyModule'View'Renderer'SmartyRenderer',
            ),
        ),
. . .