首先,由于我的ISP,我无法使用作曲家,因此,我需要一种方法来手动安装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
文件中设置自动加载:
{
"autoload": {
"psr-0": {
"Doctrine''Bundle''FixturesBundle": "vendor/doctrine/doctrine-fixtures-bundle",
"Doctrine''Common''DataFixtures": "vendor/doctrine/data-fixtures/lib",
}
}
}
作曲家在composer update
上自动执行此操作,但由于您没有使用作曲家安装包,因此没有为这些包执行此操作。