我已经使用composer来安装CakePHP 3,而它仍在开发中,所以composer。Json文件包含dev-versions。
作曲家。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
?
这取决于你想对你得到的版本有多严格。Composer文档中有关于所有可能性的信息。
我通常做的是将cakephp/cakephp
版本约束更改为~3.1.0
。这意味着我将获得Cake 3.1.x的所有维护补丁。如果你想在它发布的时候得到3.2,那么我会把它改成~3.2.0
。我这样做是为了对次要版本进行非常具体的控制。
最后,这是你的选择。如果你想,你可以设置它自动抓取任何新的次要版本。
更新: composer update
另外,你也可以看看https://github.com/cakephp/app/blob/master/composer.json寻找灵感