- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我无法解决 fixtures bundle 的大问题。我按照应遵循的步骤进行操作,将行添加到deps 文件,安装它们,在自动加载中注册它们和应用内核。
当我尝试只运行 app/console
时,它会中断:
fatal error :类 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand'
在/var/www/.../bundles/Doctrine/Bundle/FixturesBundle/中找不到
第 40 行的 Command/LoadDataFixturesDoctrineCommand.php
这似乎是对的,因为我没有 DoctrineBundle 目录在 Doctrine\Bundle
下,只有 DoctrineFixturesBundle
。如果我将该行更改为 Symfony\Bundle\DoctrineBundle\...
它会起作用完美,因为该类实际上位于该 namespace 下。
我当然不能就这样离开。我搜索了文档、问题和所有内容,但似乎没有人有同样的问题,所以我一定遗漏了一些明显的问题点这里。
有什么想法吗?
谢谢
最佳答案
不久前,所有Doctrine bundles moved to the Doctrine organizaton .根据您使用的存储库和分支,这会导致一些混淆。
如果您使用的是 Symfony 2.0.x,那么您的 deps
应该看起来像这样:
[DoctrineFixturesBundle]
git=http://github.com/doctrine/DoctrineFixturesBundle.git
target=bundles/Symfony/Bundle/DoctrineFixturesBundle
version=origin/2.0
注意目标/命名空间实际上是 Symfony\Bundle\DoctrineFixturesBundle
。
但是,在 Symfony 2.0.x 中使用最新的 DoctrineFixturesBundle
应该没有任何问题——只要您也升级其余的 Doctrine 依赖项。您可以在您的 deps
中使用它:
[doctrine-common]
git=http://github.com/doctrine/common.git
version=2.2.0
[doctrine-dbal]
git=http://github.com/doctrine/dbal.git
version=2.2.1
[doctrine]
git=http://github.com/doctrine/doctrine2.git
version=2.2.0
[doctrine-fixtures]
git=http://github.com/doctrine/data-fixtures.git
[DoctrineFixturesBundle]
git=http://github.com/doctrine/DoctrineFixturesBundle.git
target=bundles/Doctrine/Bundle/FixturesBundle
关于php - Symfony2 DoctrineFixturesBundle 命名空间错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9657036/
我有一个 Company 实体,其中每个公司在层次树结构中都有另一个母公司。 在应用程序中一切正常,所以我确定我的实体类是正确的。 问题是,如果数据库中已经有内容,那么做 doctrine:fixtu
首先,由于我的 ISP,我不能使用 composer,所以,我需要一种手动安装 DoctrineFixturesBundle 的方法,所以我开始从 github 下载它>,还有 data-fixtur
我的应用程序需要在某些表中存在一些行才能在部署时正常运行。但是,我不确定 DoctrineFixturesBundle 是否编写为在生产服务器上运行。它在我的开发机器上运行得非常好,但是在生产中使用它
我无法解决 fixtures bundle 的大问题。我按照应遵循的步骤进行操作,将行添加到deps 文件,安装它们,在自动加载中注册它们和应用内核。 当我尝试只运行 app/console 时,它会
我尝试安装现有的 Symfony 2.0 项目,因此我运行 rm -rfvendor 和 bin/vendor 安装。他找不到 DoctrineFixturesBundle,所以我更新了我的 deps
我是一名优秀的程序员,十分优秀!