composer install -n --ignore-platform-reqs不忽略PHP扩展

时间:2019-03-29 22:35:23

标签: drupal composer-php circleci

我们有一个运行composer install -n --ignore-platform-reqs --no-dev的循环构建,但这不再忽略平台要求。

这是我在圈子日志中看到的内容。 --ignore-platform-reqs显然无法正常工作。有什么主意吗?

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drupal/core 8.6.13 -> satisfiable by drupal/core[8.6.13].
    - drupal/core 8.6.13 requires ext-pdo * -> the requested PHP extension pdo is missing from your system.
  Problem 2
    - typo3/phar-stream-wrapper v2.1.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - typo3/phar-stream-wrapper v2.1.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - Installation request for typo3/phar-stream-wrapper v2.1.0 -> satisfiable by typo3/phar-stream-wrapper[v2.1.0].

2 个答案:

答案 0 :(得分:2)

与其使用--ignore-platform-reqsprovide骇客,不如使用platform设置来模仿您的环境,效果更好-它可以使您对平台要求有更多的控制,并且比{{1 }}(您的软件包并未真正提供provide):

ext-fileinfo

您可以通过在生产环境中调用此命令来找到扩展的实际版本(尽管您可以为扩展版本添加任何内容-很少使用"config": { "platform": { "php": "7.2.14", "ext-fileinfo": "1.0.5", "ext-pdo": "7.2.14", "ext-session": "7.2.14", "ext-iconv": "7.2.14", "ext-zip": "1.15.4" } }, 以外的任何内容作为PHP扩展的约束):< / p>

*

答案 1 :(得分:0)

我要回答我自己的问题,以防万一有人在这里绊倒。在我的Weight 0: 1 Profit 0: 2 Weight 1: 1 Profit 1: 11 Weight 2: 2 Profit 2: 2 Weight 3: 1 Profit 3: 7 Weight 4: 2 Profit 4: 6 Found incumbent of value 28.000000 after 0.00 sec. (0.00 ticks) Root node processing (before b&c): Real time = 0.00 sec. (0.00 ticks) Parallel b&c, 8 threads: Real time = 0.00 sec. (0.00 ticks) Sync time (average) = 0.00 sec. Wait time (average) = 0.00 sec. ------------ Total (root+branch&cut) = 0.00 sec. (0.00 ticks) Obj = 28.0 文件中添加带有扩展名列表的商品为我解决了该问题。此composer.json无效。

--ignore-platform-reqs