更新Cakephp3应用程序核心库的推荐方法是什么?

时间:2015-08-28 13:46:57

标签: cakephp composer-php cakephp-3.0

我使用composer来安装CakePHP 3,但它仍在开发中,因此composer.json文件包含dev-versions。

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

{
    "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

2 个答案:

答案 0 :(得分:2)

这取决于您希望获得的版本的严格程度。 Composer Documentation有关于所有可能性的信息。

我通常做的是将overflow: hidden; text-overflow: ellipsis; 版本约束更改为SELECT * FROM t_friend WHERE user_id=10 OR friend_id=10 。这意味着我将获得Cake 3.1.x的所有维护补丁。如果您希望在发布时获得3.2,那么我会将其更改为cakephp/cakephp。我这样做是为了对次要版本进行非常具体的控制。

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

更新:

~3.1.0

答案 1 :(得分:0)

此外,您还可以查看https://github.com/cakephp/app/blob/master/composer.json的灵感