Below, composer uses the tutorial column to introduce to you how to update and lower the version of composer update. I hope it will be helpful to friends in need!
1. I originally wanted to upgrade to 5.0.23. I updated in the root directory and directly upgraded to 5.1.31. I felt that the version was a bit high. I wanted to downgrade to 5.0.23. The plan is as follows :
Enter the root directory vim and open the composer.json file
"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" },
Mainly look at this code. If you want to update to the desired version, you only need to modify topthink /framework
Explanation: "^5.0" The ^ in front will directly detect the latest version update
Modification method 1: "topthink/framework": "5.0.*" Remove the ^ in front and add it after *, indicating updating to the latest version of 5.0.
Modification method 2: "topthink/framework": "5.0.23" specifies the version, indicating updating to version 5.0.23
Running results:
For more composer-related technical articles, please visit the composer column: https://www.php.cn/tool/composer/
The above is the detailed content of Composer update method to update and lower the version. For more information, please follow other related articles on the PHP Chinese website!