composer 如何只更新一个,而不是全部?


使用 yii2 框架,更改了一个 require ,可使用 composer update g9901/yii2-gftp 却所有的全部都在更新一遍,实现只更新 g9901/yii2-gftp 这一个的composer 命令是如何书写?


 # /home/flxx/basic/composer.json
{
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Application Template",
    "keywords": ["yii2", "framework", "basic", "application template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "2amigos/yii2-ckeditor-widget": "*",
        "yiisoft/yii2-jui": "*",
        "2amigos/yii2-date-time-picker-widget": "~1.0",
        "g9901/yii2-gftp": "*"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        },
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

composer yii2

kbmgs 9 years, 7 months ago

同问,我也看过composer的文档,都操作了下,发现都是更新全部。不知道该怎么写才能对特定的插件进行更新,并且更新到最新版本?

超威金坷垃 answered 9 years, 7 months ago

Your Answer