我已经通过该命令安装了Symfony:
php composer.phar create-project symfony/framework-standard-edition symfonyProject
一切顺利,但随后我创建了一个捆绑包:
php bin/console generate:bundle
nameSpace : OC/PlatformBundle
Bundle naem : OCPlatformBundle
destination : /src
format : yml
现在一切正常,除了名称空间在网页app_dev.php上显示错误并显示错误时显示错误:
" (1/1) ClassNotFoundException ".
我浏览了多个论坛,这些论坛建议修改以下的composer.json文件:
"autoload": {
"psr-4": { "AppBundle\\": "src/AppBundle", "OCPlatformBundle\\": "src/OCPlatformBundle" },
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": { "": "src/" },
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
然后他们建议输入命令:
composer dump-autoload
问题出在这里,我输入了命令,但得到的只是:
Either the file is displayed on the command line
Either windows ask me which software I want to use to open the file
Or it simply tells me that the composer is not recognized as an intern command
我不知道如何使作曲家转储自动加载工作
我精确地指出命令:
composer.phar dump-autoload
没什么大不了的,Windows再问我一次我想如何打开该文件