1. 程式人生 > >composer update 更新降低版本方法

composer update 更新降低版本方法

1.本來想升級到5.0.23,在根目錄下更新直接升級到5.1.31感覺版本有點高了,想降到5.0.23方案如下:

進入根目錄vim開啟composer.json 檔案

"require": {
        "php": ">=5.4.0",
        "topthink/framework": "^5.0",
        "topthink/think-captcha": "^1.0",
        "topthink/think-image": "^1.0",
        "topthink/think-helper": "^1.0",
        "ezyang/htmlpurifier": "^4.9"
    },

主要看這塊程式碼,想要更新到想要的版本只需要修改topthink/framework

解釋:"^5.0"  前面的^會直接檢測最新版本更新

修改方法1:"topthink/framework": "5.0.*" 去掉前面的^後面加*,表示更新到5.0.的最新版本

修改方法2:"topthink/framework": "5.0.23" 指定版本,表示更新到5.0.23版本

執行結果: