dqalnwuci494308 2013-10-08 10:59
浏览 53
已采纳

symfony2如何注册未通过composer安装的bundle

I have a bundle which I had to clone from a private repo, and cloned it from the vendor directory, and registered the bundle in the AppKernel.php now, I am getting an error that says, PHP fatal error: Class 'foo\foobar\example not found in C:\... AppKernel.php

So, my question is how do I make sure, pacakges not installed through composer get registered in the autoloader

  • 写回答

1条回答 默认 最新

  • dongmu9253 2013-10-08 11:08
    关注

    The best way would be not to pull manualy from your private repo, but use composer also in this case.

    To accomplish this, you will need a private composer repository - like one with satis.

    If that is not an option for any reason, you can configure the autoloader in your project /composer.json like this:

    {
        "name": "...",
        "autoload": {
            "psr-0": {
                "MyVendor\\MyBundleBundle": "vendor/foo",
            }
        },
        ....
    }
    

    But I strongly recommend the satis way.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建