建议使用什么方法来更新Cakephp3应用程序的核心库 [英] What's the recommended approach for updating the core lib of a Cakephp3 app

查看:60
本文介绍了建议使用什么方法来更新Cakephp3应用程序的核心库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在composer.json文件包含dev-versions的时候,使用composer来安装CakePHP 3.

I've used composer to install CakePHP 3 while it still was in development, so the composer.json file contains dev-versions.

composer.json文件现在看起来像这样:

The composer.json file looks like this right now:

{
    "name": "cakephp/app",
    "description": "CakePHP skeleton app",
    "homepage": "http://cakephp.org",
    "type": "project",
    "license": "MIT",
    "require": {
        "php": ">=5.4.16",
        "cakephp/cakephp": "3.0.*-dev",
        "mobiledetect/mobiledetectlib": "2.*",
        "cakephp/migrations": "dev-master",
        "cakephp/plugin-installer": "*"
    },
    "require-dev": {
        "d11wtq/boris": "1.0.*",
        "cakephp/debug_kit": "3.0.*-dev",
        "cakephp/bake": "dev-master"
    },
    "suggest": {
        "phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
        "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
    },
    "autoload": {
        "psr-4": {
            "App\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests",
            "Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
        }
    },
    "scripts": {
        "post-install-cmd": "App\\Console\\Installer::postInstall",
        "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

现在,将应用程序更新到CakePHP 3库的最新版本的推荐方法是什么?只是更新json文件并运行 composer update ?

Now, what's the recommended approach for updating the application to whatever's the newest version of the CakePHP 3 library? Just updating the json-file and running composer update?

推荐答案

这取决于您对所获得版本的严格程度. Composer文档提供了所有可能性的信息.

It depends on how strict you want to be with the versions you get. The Composer Documentation has information on all the possibilities.

我通常要做的是将我的 cakephp/cakephp 版本约束更改为〜3.1.0 .这意味着我将获得Cake 3.1.x的所有维护补丁.如果要在发布时获得3.2,则将其更改为〜3.2.0 .我这样做也是为了对次要版本也有非常具体的控制.

What I usually do is change my cakephp/cakephp version constraint to ~3.1.0. This means I'll get all of the maintenance patches for Cake 3.1.x. If you want to get 3.2 when it's released, then I would change it to ~3.2.0. I do this to have very specific control over the minor version as well.

最后,这是您的选择.如果需要,可以将其设置为自动获取任何新的次要版本.

In the end, it's your choice. You can set it up to automatically grab any new minor versions if you want to.

要更新:

合成器更新

这篇关于建议使用什么方法来更新Cakephp3应用程序的核心库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆