Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Doctrine orm 在symfony 2.1.4中安装条令数据固定装置_Doctrine Orm_Symfony 2.1 - Fatal编程技术网

Doctrine orm 在symfony 2.1.4中安装条令数据固定装置

Doctrine orm 在symfony 2.1.4中安装条令数据固定装置,doctrine-orm,symfony-2.1,Doctrine Orm,Symfony 2.1,以下是我所做的:\ 在composer.json中添加了以下依赖项 "doctrine/doctrine-fixtures-bundle": "dev-master", "doctrine/data-fixtures": "dev-master" 在终端上运行以下命令: php composer.phar更新 在appKernel.php中添加了以下行 新条令\Bundle\FixturesBundle\DoctrineFixturesBundle() 当我在提示符下运行任何symfony命

以下是我所做的:\

  • 在composer.json中添加了以下依赖项

    "doctrine/doctrine-fixtures-bundle": "dev-master",
    "doctrine/data-fixtures": "dev-master"
    
  • 在终端上运行以下命令:

    php composer.phar更新

  • 在appKernel.php中添加了以下行

    新条令\Bundle\FixturesBundle\DoctrineFixturesBundle()

  • 当我在提示符下运行任何symfony命令时,我得到如下错误:

    Class not found: Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle 
    
    然后我打开vendor\composer\autoload_namespace.php并添加了以下行:

     'Doctrine\\Bundle\\FixturesBundle' => $vendorDir . '/doctrine/doctrine-fixtures-bundle/'
    
    错误消失了,我可以轻松地使用数据夹具

    我的问题是,当我运行composer update时,是应该将名称空间自动插入vendor\composer\autoload_namespaces.php,还是必须手动将上面的行插入autoload_namespaces.php? 在文档中,我没有找到任何说明手动插入名称空间的内容