将CakePHP安装从3.0.13升级到3.8

问题描述 投票:0回答:1

我的CakePHP 3.0.13安装正常。在尝试跳转到4.x分支之前,我想升级到3.8。我启动了这个:composer require cakephp/cakephp:3.8.12,我得到下一个结果:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
    - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
    - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
    - Installation request for cakephp/migrations 1.3.2 -> satisfiable by cakephp/migrations[1.3.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.

似乎迁移软件包存在依赖性问题:Cake需要对Migrations进行升级,但是Migrations需要Cake保持3.0。*。在vendor/cakephp/migrations/composer.json中,我有:

    ...
    "require": {
        "php": ">=5.4",
        "robmorgan/phinx": ">=0.4.2 <0.5.0",
        "cakephp/cakephp": "3.0.*"
    },
    ...

我也尝试过使用composer升级Migrations,但是我遇到了相反的问题:cakephp应该被升级,所以我陷入了困境。有什么建议么?提前谢谢!

cakephp composer-php migration cakephp-3.x
1个回答
0
投票

我想我已经找到问题了。正如@ndm和@ Nico-haase指出的,我已经审阅了composer.json文件。在其他软件包之间,我有: ... "cakephp/cakephp": "~3.0.13", "cakephp/migrations": "1.3.2", ... ...当我尝试将CakePHP升级到3.8.12时,我也应该升级了Migrations,因为Migrations 1.3.2运行在cake 3.0.13而不是3.8中。这就是为什么它不起作用。现在,我将3.8.12用于Cake,仅将@stable用于迁移。

... "cakephp/cakephp": "~3.8.12", "cakephp/migrations": "@stable", ...

升级了平台要求(php版本,libs等)后,我已经成功启动了composer install。非常感谢!

© www.soinside.com 2019 - 2024. All rights reserved.