首先,由于我的 ISP,我无法使用 Composer,所以,我需要一种方法来安装DoctrineFixturesBundle
手动,所以我开始从github
,还有data-fixtures
捆。
我在我的项目中创建这个文件夹结构
vendor
- doctrine
- doctrine-fixtures-bundle
- Doctrine
- Bundle
- FixturesBundle
DoctrineFixturesBundle.php
..other files...
vendor
- doctrine
- data-fixtures
- lib
- test
composer.json
..other files...
我通过读取每个包中的composer.json 文件来做到这一点,然后我编辑了AppKernel.php
并添加了
public function registerBundles(){
.....
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
.....
}
但它不起作用,我总是得到:
Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not
found in D:\wamp\www\cupon\app\AppKernel.php on line 20
我错过了什么吗?我可以手动安装这些捆绑包吗?
希望你能帮我。
谢谢
我认为你需要在你的中设置自动加载composer.json
file:
{
"autoload": {
"psr-0": {
"Doctrine\\Bundle\\FixturesBundle": "vendor/doctrine/doctrine-fixtures-bundle",
"Doctrine\\Common\\DataFixtures": "vendor/doctrine/data-fixtures/lib",
}
}
}
Composer 自动执行此操作composer update
,但由于您没有使用 Composer 安装软件包,因此未对这些软件包执行此操作。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)