Skip composer PHP requirement(跳过作曲家 PHP 要求)
问题描述
我们正在使用 PHPCI 和 composer.运行 PHPCI 的服务器是 PHP 5.3.
We are using PHPCI and composer. The server which runs PHPCI is on PHP 5.3.
对于一个项目,我们使用 composer 添加了 Facebook PHP SDK.它需要 PHP 5.4.Composer 被 PHPCI 触发并被执行.但是因为 CI 服务器刚刚获得 PHP 5.3 composer 失败并显示错误消息:
For a project we added the Facebook PHP SDK, using composer. It requires PHP 5.4. Composer gets triggered by PHPCI and get executed. But because the CI server just got PHP 5.3 composer failed with the error message:
facebook/php-sdk-v4 4.0.9 requires php >=5.4.0 -> no matching package found.
这当然会让我在 PHPCI 中的构建失败.
This let fail my build in PHPCI, of course.
是否有可能跳过此要求?也许通过向 composer.json 添加一个选项?还是 composer.phar 调用的参数?
Is there a possibility to skip this requirement? Maybe by adding an option to composer.json? Or a parameter to composer.phar call?
推荐答案
我找到了选项:
composer install --ignore-platform-reqs
忽略平台要求(php & ext-packages).
Ignore platform requirements (php & ext- packages).
你可以跳过平台检查,但 Composer 将根据给定的 PHP 版本获取包.因此,当您需要 composer 在依赖解析期间模拟 PHP 版本时,您可以(并且应该!)在您的 composer.json 中使用它:
You can skip the platform checks with this, but Composer will fetch packages based on given PHP version then. So when you need composer to also emulate a PHP version during depedency resolving, you can (and should!) use this in your composer.json:
{
"config": {
"platform": {
"php": "5.6.6"
}
}
}
https://getcomposer.org/doc/06-config.md#platform
这篇关于跳过作曲家 PHP 要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:跳过作曲家 PHP 要求
基础教程推荐
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
