【问题标题】:Symfony 2: LiipDoctrineCacheBundle not found in AppKernelSymfony 2:在 AppKernel 中找不到 LiipDoctrineCacheBundle
【发布时间】:2013-05-01 14:14:30
【问题描述】:

我已经在我网站的 vendor\bundles\ 文件夹中安装了这个捆绑包 LiipDoctrineCacheBundle

然后,像往常一样,我在 autoload.php 中在数组命名空间中添加了一个新条目:

'Liip' => __DIR__.'/../vendor/bundles',

我在 AppKernel.php 的 bundles 数组中注册了这个新的 bundle:

new Liip\DoctrineCacheBundle\LiipDoctrineCacheBundle(),

但奇怪的是我收到了这个错误信息:

Fatal error: Class 'liip\DoctrineCacheBundle\LiipDoctrineCacheBundle' not found in C:\workspace\LHN\app\AppKernel.php on line 26

这就像 Symfony 无法在名称空间中检索包...

所以我尝试更改捆绑密钥的大小写:'Liip'==> 'liip'

我也尝试过使用完整路径位置: __DIR__.'/../vendor/bundles' ==> C:\workspace\mySite\vendor\bundles

有什么想法吗?

感谢

Symfony:2.0.9 Liip 捆绑包:master

【问题讨论】:

    标签: symfony bundle


    【解决方案1】:

    您可能使用了错误的包类名称。 我觉得应该是

    new Liip\LiipDoctrineCacheBundle\LiipDoctrineCacheBundle()
    

    new liip\LiipDoctrineCacheBundle\LiipDoctrineCacheBundle()
    

    不确定第一个“L”是否在您的供应商/捆绑包/来源中是大写

    【讨论】:

      【解决方案2】:

      感谢 Laurynas 的评论,我明白了我的问题:源包路径错误
      vendor\bundles\liip\LiipDoctrineCacheBundle

      而不是

      vendor\bundles\Liip\DoctrineCacheBundle

      这个问题的根源是我在deps文件中犯了一个错误(git locationversion和target 目录)通过将 target 属性设置为 /bundles/liip/LiipDoctrineCacheBundle 而不是 /bundles/Liip/DoctrineCacheBundle。

      我的错... ;-)

      正确的 dep 块:

      [LiipDoctrineCacheBundle]
       git=https://github.com/liip/LiipDoctrineCacheBundle.git
       target=/bundles/Liip/DoctrineCacheBundle
       version=master
      

      【讨论】:

        猜你喜欢
        • 2017-04-01
        • 2012-05-25
        • 2017-03-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多