我有一个Laravel 5.2.12项目(网站),这是一个大项目,几乎完成了...有没有简单的方法可以在不影响项目(不影响已经完成的工作)的情况下将Laravel从5.2.12更新到5.2.31?我该怎么做?
那么,问题是如何将现有项目上的 Laravel 版本从 5.2.12 更新到 5.2.31?
编辑:这是我的作曲家.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"cartalyst/sentinel": "2.0.*",
"intervention/image": "^2.3",
"barryvdh/laravel-debugbar": "^2.2",
"slynova/laravel-commentable": "^2.0",
"barryvdh/laravel-ide-helper": "v2.2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r "copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
应该更改什么才能将Laravel更新到5.2.31(到最新的5.2版本)?
更新composer.json
以在您想要的版本上使用laravellaravel
。然后在命令行中运行composer update
。
您的项目从5.2.12
更新到5.2.31
应该没有任何问题,因为它们大多是错误修复。但请注意,其他依赖项可能会更新到新版本。因此,如果原因出现问题,您可能希望在composer.json
文件中将它们设置为固定版本。