关于symfony:Symfony2-作曲家弄乱了我的网站,因为所有捆绑包都不存在

Symfony2 - Composer messed up my site as all bundles don't exist

在开始使用Composer之前,我的Symfony2设置一切都很棒。

我确实在Composer上安装了Symfony2,但随后手动添加了捆绑软件-包括我自己创建的捆绑软件。

然后,我需要添加一些使用Composer似乎更容易的东西。后来在终端中发生了很多混乱,然后我在浏览器中运行时发现AppKernel.php中出现错误,提示不存在任何捆绑软件-包括:

1
FatalErrorException: Error: Class 'Acme\\DemoBundle\\AcmeDemoBundle' not found in /path/app/AppKernel.php line 39

我是100%的文件夹,除了运行各种Composer命令外,没有任何改变。

Composer没有对这些捆绑软件的引用。

我该如何解决?我猜我要么告诉Composer清除(像以前一样),要么以某种方式让Composer理解这些捆绑软件。

我猜这与引导文件有关。我相信Composer将在更新后创建一个,但这就是我在努力的地方。

-

composer.json:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"name":"symfony/framework-standard-edition",
"description":"The "Symfony Standard Edition" distribution",
"autoload": {
   "psr-0": {"":"src/" }
},
"require": {
   "php":">=5.3.3",
   "symfony/symfony":"2.2.*",
   "doctrine/orm":"~2.2,>=2.2.3",
   "doctrine/doctrine-bundle":"1.2.*",
   "twig/extensions":"1.0.*",
   "symfony/assetic-bundle":"2.1.*",
   "symfony/swiftmailer-bundle":"2.2.*",
   "symfony/monolog-bundle":"2.2.*",
   "sensio/distribution-bundle":"2.2.*",
   "sensio/framework-extra-bundle":"2.2.*",
   "sensio/generator-bundle":"2.2.*",
   "jms/security-extra-bundle":"1.4.*",
   "jms/di-extra-bundle":"1.3.*"
},
"scripts": {
   "post-install-cmd": [
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::buildBootstrap",
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::clearCache",
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::installAssets",
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::installRequirementsFile"
    ],
   "post-update-cmd": [
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::buildBootstrap",
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::clearCache",
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::installAssets",
       "Sensio\\\\Bundle\\\\DistributionBundle\\\\Composer\\\\ScriptHandler::installRequirementsFile"
    ]
},
"config": {
   "bin-dir":"bin"
},
"minimum-stability":"alpha",
"extra": {
   "symfony-web-dir":"web",
   "symfony-app-dir":"app",
   "branch-alias": {
       "dev-master":"2.2-dev"
    }
}

} ??


我认为您没有更新app/autoload.php文件。检查标准分发的来源:https://github.com/symfony/symfony-standard/blob/master/app/autoload.php

您需要包括由作曲家生成的vendor/autoload.php