简体   繁体   English

Symfony2作曲家在不更新其他依赖项的情况下安装了一个新捆绑包

[英]Symfony2 composer installing one new bundle without updating other dependencies

I have a stable project thats been in production for a year now, but the time has come for some upgrades. 我有一个稳定的项目,已经投入生产了一年,但是现在该进行一些升级了。 I want to install a new bundle, but I dont want to update any other packages to their new versions. 我想安装一个新的软件包,但是我不想将任何其他软件包更新为它们的新版本。

When I deploy the project i do composer.phar install witch installs the vendors from composer.lock file with the right versions. 当我部署项目时,我会执行composer.phar install witch安装带有正确版本的composer.lock文件中的供应商。 Everything is fine here. 这里一切都很好。

I cant do composer.phar update because that will update all of the vendors + it throws hundred dependency errors anyway. 我不能做composer.phar update因为这将更新所有供应商,并且无论如何都会引发一百个依赖错误。

I want to istall just one new vendor. 我只想成立一个新的供应商。

My composer.json looks like this: 我的composer.json看起来像这样:

"require": {
        "php": ">=5.3.9",
        "symfony/symfony": "2.7.*",
        "doctrine/orm": "^2.4.8",
        "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.2",
        "incenteev/composer-parameter-handler": "~2.0",
        "friendsofsymfony/user-bundle": "~1.3",
        "sonata-project/core-bundle": "dev-master",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
        "sonata-project/datagrid-bundle": "dev-master",
        "sonata-project/classification-bundle": "dev-master",
        "sonata-project/easy-extends-bundle": "dev-master",
        "sonata-project/media-bundle": "dev-master",
        "sonata-project/intl-bundle": "dev-master",
        "sonata-project/user-bundle": "dev-master",
        "sparkling/adyen-bundle": "^0.3.4",
        "sylius/translation-bundle": "^0.15.0",
        "sylius/shipping-bundle": "^0.15.0",
        "sylius/resource-bundle": "0.15.*",
        "sylius/payment-bundle": "0.15.*",
        "winzou/state-machine-bundle": "^0.2.2",
        "sylius/currency-bundle": "^0.15.0",
        "sylius/money-bundle": "^0.15.0",
        "ddeboer/data-import-bundle": "dev-master",
        "eko/feedbundle": "1.2.5",
        "ed/blog-bundle": "v1.0.3",
        "knplabs/knp-paginator-bundle": "dev-master",
        "hwi/oauth-bundle": "^0.3.9",
        "facebook/php-sdk-v4": "^5.1",
        "friendsofsymfony/jsrouting-bundle": "^1.6",
        "knplabs/knp-snappy-bundle": "^1.3",
        "oneup/uploader-bundle": "~1.3",
        "suncat/mobile-detect-bundle": "^0.10.2",
        "friendsofsymfony/elastica-bundle": "^3.1",
        "beberlei/DoctrineExtensions": "^1.0",
        "stfalcon/tinymce-bundle": "1.0"
    },

The last bundle in the list: "stfalcon/tinymce-bundle": "1.0" is the bundle I want to install. 列表中的最后一个软件包: "stfalcon/tinymce-bundle": "1.0"是我要安装的软件包。 I added this by hand. 我是手动添加的。

After adding the bundle I am trying to do: 添加捆绑包后,我尝试执行以下操作:

php -d memory_limit=-1 composer.phar update stfalcon/tinymce-bundle --with-dependencies

This still throws errors: 这仍然会引发错误:

Domas@Lenovo-PC MINGW64 /c/wamp64/www/karpedeal (develop)
endenciesmemory_limit=-1 composer.phar update stfalcon/tinymce-bundle --with-depe
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package sensio/distribution-bundle == 3.0.31.0 is satisfiable by sensio/distribution-bundle[v3.0.31] but those are rejected by your minimum-stability.
  Problem 2
    - The requested package sonata-project/intl-bundle == 2.2.3.0 is satisfiable by sonata-project/intl-bundle[2.2.3] but those are rejected by your minimum-stability.
  Problem 3
    - The requested package knplabs/knp-paginator-bundle == 2.5.0.0 is satisfiable by knplabs/knp-paginator-bundle[2.5.0] but those are rejected by your minimum-stability.
  Problem 4
    - sonata-project/user-bundle dev-master conflicts with sonata-project/intl-bundle[dev-master].
    - sonata-project/intl-bundle dev-master conflicts with sonata-project/user-bundle[dev-master].
    - sonata-project/intl-bundle dev-master conflicts with sonata-project/user-bundle[dev-master].
    - Installation request for sonata-project/intl-bundle dev-master -> satisfiable by sonata-project/intl-bundle[dev-master].
    - Installation request for sonata-project/user-bundle dev-master -> satisfiable by sonata-project/user-bundle[dev-master].

I dont know what else to do.. Is there a way to install new bundles without having these problems? 我不知道该怎么办。.是否可以在没有这些问题的情况下安装新的捆绑软件?

It should be as simple as removing it from your composer.json and execute : 它应该像从composer.json中删除并执行以下命令一样简单:

php composer.phar require stfalcon/tinymce-bundle:1.0

If you still have any errors, it may be due to the dependencies of this particular bundle conflicting or being incompatible with your own dependencies. 如果您仍然有任何错误,则可能是由于此特定捆绑软件的依赖项冲突或与您自己的依赖项不兼容。

And you should definitely not rely on dev-master version. 而且您绝对不应该依赖dev-master版本。 Use specific versions instead like "^3.10.0" for every requirement to your app. 为您的应用程序的每个要求使用特定的版本,例如“ ^ 3.10.0”。 Master branch on a project may not be stable and up-to-date, specifically regarding to the composer.json dependencies declarations. 项目上的Master分支可能不稳定且不是最新的,特别是关于composer.json依赖项声明。 Replacing dev-master by an accurate choice may fix your issues. 通过正确的选择替换dev-master可能会解决您的问题。

A simpler command from your Symfony2 directory is: 您的Symfony2目录中的一个更简单的命令是:

composer require stfalcon/tinymce-bundle "dev-master"

I think it should work, can you try it? 我认为应该可以,可以尝试吗?

This is a best way to install bundle 这是安装捆绑软件的最佳方法

I have faced same problem today and i have installed specific bundle using require command 我今天也遇到了同样的问题,并且使用require命令安装了特定的捆绑软件

like : 喜欢 :

composer require bundleName version

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM