gpt4 book ai didi

symfony2 包自动加载失败

转载 作者:行者123 更新时间:2023-12-03 01:39:21 24 4
gpt4 key购买 nike

我碰巧得到了创作的所有 symfony 问题......

我想创建一个新项目。

我复制“symfony2”文件夹,然后重命名:

 php app/console generate:bundle

它说:

  Generating the bundle code: OK
Checking that the bundle is autoloaded: FAILED
Confirm automatic update of your Kernel [yes]?
Enabling the bundle inside the Kernel: OK
Confirm automatic update of the Routing [yes]?
Importing the bundle routing resource: FAILED

The command was not able to configure everything automatically.
You must do the following changes manually.

- Edit the composer.json file and register the bundle
namespace in the "autoload" section:

Bundle MddevPsavBundle is already imported.

这是为什么呢?当我上次没有遇到这个问题时,我执行了相同的命令?

我该如何准确地解决这个问题?我应该在 composer.json 文件中添加什么??

我尝试过一些东西,但我得到:

  Fatal error: Class 'Mddev\PsavBundle\MddevPsavBundle' not found in
/var/www/projetQ/app/AppKernel.php on line 22

最佳答案

如果您遇到问题:

The command was not able to configure everything automatically.  
You must do the following changes manually.

然后告诉你:

- Edit the composer.json file and register the bundle
namespace in the "autoload" section:

假设您已关注 bundle name conventions正确的话,那么您需要:

<小时/>

将新包添加到composer.json文件

"autoload": {
"psr-0": {
"currentbundle\\": "src/",
"YOURNEWBUNDLE\\": "src/",
}
}

然后您需要再次在 Composer 上运行安装

composer -n install --dev

然后您应该自动加载两个包

关于symfony2 包自动加载失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13213010/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com