quot;Argument 1 passed to ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() must be an instance...quot;(“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct()
问题描述
在尝试安装 Api-Platform(或在现有 Api-Platform 安装上运行 composer update
时,我收到如下错误:
While attempting to install Api-Platform (or run composer update
on an existing Api-Platform installation, I get an error like this:
未捕获的错误:参数 1 传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 必须是 DoctrineCommonPersistenceManagerRegistry 的实例,DoctrineBundleDoctrineBundle 的实例给定的注册表,在第 1530 行的 App_KernelDevDebugContainer.php 中调用 [异常"=>类型错误 { …}]
Uncaught Error: Argument 1 passed to ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() must be an instance of DoctrineCommonPersistenceManagerRegistry, instance of DoctrineBundleDoctrineBundleRegistry given, called in App_KernelDevDebugContainer.php on line 1530 ["exception" => TypeError { …}]
如何才能正确安装 Api-Platform?为什么更新失败?
What can I do to be able to install Api-Platform correctly? Why is it failing on an update?
推荐答案
在新版本的 Api-Platform 发布之前(可能会相对较快),您可以通过将其添加到您的 composer 来回避这个问题.json
:
Until a new version of Api-Platform is released (which will probably be relatively soon), you can sidestep the issue by adding this to your composer.json
:
"conflict": {
"doctrine/common": ">= 3.0",
"doctrine/persistence": "^1.0"
}
(由于您可能已经有一个 conflict
键,只需将一行添加到您现有的 conflict
规则中).
(Since you are likely to already have a conflict
key, just add the one line to your existing conflict
rules).
doctrine/common
新版本发布,当前版本的Api-Platform不兼容.
A new version ofdoctrine/common
was released, and the current version of Api-Platform is not compatible with it.
在不久的将来,一旦新版本的 Api-Platform 发布,您就可以删除该行.
Sometime in the near future you'll be able to remove that line, once a new version of Api-Platform is released.
这里是一个问题,大家可以关注讨论,并希望在此捆绑包级别解决问题的时间.
Here is an issue where you can keep an eye on the discussion, and hopefully track when the issue is resolved at this bundle's level.
这不再是必要的.您可以使用最新的 Api-Platform 包更新到最新的 Doctrine 包,并且每个包都可以正常工作.
This is no longer necessary. You can update to the latest Doctrine packages with the latest Api-Platform package, and every works fine together.
这篇关于“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"
基础教程推荐
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01