通过忽略其依赖项之一来安装composer包

时间:2015-09-25 08:23:03

标签: symfony composer-php

我有一个Symfony2项目,想要添加AdminGenerator

所以我

Vertex3D::Vertex3D(float x0, float y0, float z0) : x(x0), y(y0), z(z0) { }

并收到以下错误

composer require cedriclombardot/admingenerator-generator-bundle

这是显而易见的,我有twig / extensions 1.3并且包需要我Your requirements could not be resolved to an installable set of packages. Problem 1 - cedriclombardot/admingenerator-generator-bundle v1.1.3 requires twig/extensions 1.0.* -> no matching package found. - cedriclombardot/admingenerator-generator-bundle v1.1.2 requires twig/extensions 1.0.* -> no matching package found. - cedriclombardot/admingenerator-generator-bundle v1.1.1 requires twig/extensions 1.0.* -> no matching package found. - cedriclombardot/admingenerator-generator-bundle v1.1.0 requires twig/extensions 1.0.* -> no matching package found. - Installation request for cedriclombardot/admingenerator-generator-bundle ^1.1 -> satisfiable by cedriclombardot/admingenerator-generator-bundle[v1.1.0, v1.1.1, v1.1.2, v1.1.3]. 。如果我将twig / extensions降级为1.0.*它的效果非常好,但我不想这样做,因为它有很多不赞成使用的东西,很快就会在它的2.0版本中删除它们。

如何在将1.0.*包保留在版本twig/extensions的同时安装admin生成器包?

我的composer.json需要,如果它有帮助:

1.3

我想这样做不仅是为了拥有最新版本,而且因为我稍后会做 "require": { "php": ">=5.3.9", "symfony/symfony": "2.7.*", "doctrine/orm": "~2.2,>=2.2.3,<2.5", "doctrine/dbal": "<2.5", "doctrine/doctrine-bundle": "~1.4", "symfony/assetic-bundle": "~2.3", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~4.0", "sensio/framework-extra-bundle": "~3.0,>=3.0.2", "incenteev/composer-parameter-handler": "~2.0", "doctrine/doctrine-migrations-bundle": "^1.0", "friendsofsymfony/user-bundle": "~2.0@dev", "cunningsoft/chat-bundle": "^0.4.0", "knplabs/knp-time-bundle": "^1.3", "helthe/turbolinks-bundle": "~1.1", "knplabs/knp-paginator-bundle": "^2.4", "knplabs/knp-menu-bundle": "~2", "twig/extensions": "^1.3" }, ,所以我也不想遇到问题。

1 个答案:

答案 0 :(得分:1)

不推荐摆弄供应商包的依赖关系,即使您确实找到了更改它的方法(例如,在供应商包的composer.json文件中),您也会失去使用的所有好处作曲家,因为下次更新会很乐意覆盖/破坏您的更改和整个项目。

但是看起来可能的是你可以使用包的最新分支,根本不需要Twig Extensions:

https://packagist.org/packages/cedriclombardot/admingenerator-generator-bundle#dev-master

composer require cedriclombardot/admingenerator-generator-bundle:dev-master