0

I feel like this should be a lot easier, but maybe it's not possible. I've read:

I have an application that's a few years old written in CakePHP 3. According to the upgrade guide for CakePHP 4

First, check that your application is running on latest CakePHP 3.x version.

In my composer.json I have this:

"require": {
    "php": ">=5.6",
    "cakephp/cakephp": "3.8.*",
    // ...
},

I can see it's installed 3.8.12:

% cat vendor/cakephp/cakephp/VERSION.txt
3.8.12

How do I find out what the "latest version" of CakePHP 3.x is? Can Composer identify this and install it for me? Or do I need to manually find out and then update my composer.json to a specific version of CakePHP 3.x? I can see in the composer docs how to specific a specific version. But I can't see any information about how you find out what the latest version is?

If I run composer show it will output

cakephp/cakephp 3.8.12 The CakePHP framework

But this is misleading because there are, for example, versions such as CakePHP 3.9 or 3.10, etc which are still in the 3.x range but "later" than 3.8.12

Andy
  • 5,142
  • 11
  • 58
  • 131
  • 1
    Upgrading automatically to a major version (e.g. from 3 to 4) would lead in most cases to unforeseen problems. But you can change your composer.json to install any 3.* version by changing it to `"cakephp/cakephp": "3.*",` – Andrea Olivato Mar 28 '22 at 14:19
  • You can use `composer outdated`, which shows all of the packages that are outdated. However, it doesn't always show the major version changes, so it may not show what you're looking for. – aynber Mar 28 '22 at 14:23
  • Thanks Andrea. This was unclear in the docs but has worked. I now have 3.10.2 installed – Andy Mar 28 '22 at 14:23
  • @aynber if I run that it gives 4.3.7. Although that's the version I eventually want to upgrade to, the upgrade tool for CakePHP requires that you install the "latest" 3.x first. So the method Andrea gives in the comments, `"3.*",` in composer.json works. – Andy Mar 28 '22 at 14:26

0 Answers0