CakePHP LTS Version Strategy - cakephp

The CakePHP community has frequent minor release cycles. Can anyone suggest a strategy for selecting an LTS version - specifically a minor version.
Or would the best strategy be to upgrade as frequently as the minor versions are released?

We can assume that the 2.x and 3.x branches get updates for the next few years (i'm not sure, but i think even 1.3 still get security updates if leaks are found)...
So your choice is between 2.x and 3.x where 3.x is cleaner/faster and easier extendible in form of 3th party libraries and 2.x is more wide spread(plugins, tutorials,... ). I would definitely recommend you to go with 3.x due to a higher php version(it's sooo much faster).
Cakephp releases in minor versions (3.0.x) are bug and security fixes. So if you select:
"require": {
"cakephp/cakephp": "3.0.*"
}
you should be just fine for the next few years.
If you than feel like a feature is missing which is present in a newer 3.x release you can always find a migration guide for the newest version in the cookbook: http://book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html as you can see from 2.x to 3.x there are a lot of breaking changes and an update is most likely really time consuming.
In comparison a update from 2.x to 2.6 is less complex as there are primary smaller feature improvements, renaming of functions and stuff like that: http://book.cakephp.org/2.0/en/appendices/2-6-migration-guide.html

CakePHP 3.0.x is the most current branch of CakePHP and if you're starting out with Cake is the best place to start (CakePHP 2.6.x is still being supported for the foreseeable future, but will eventually get dropped).
The recommended way of installing CakePHP is using Composer. If you want to install the current stable release then you want the following in your composer.json file:-
"require": {
"cakephp/cakephp": "3.0.*"
}
This will insure that every time you do a composer update you'll only get bug fixes and minor changes that shouldn't break your app. Ideally you want to ensure your app is bug free so it is a good idea to periodically update Cake with these minor version changes.
When CakePHP 3.1.x is released in the future it is likely to introduce new features that have the potentially to break an app's existing functionality. In this case upgrading needs to be done with caution. You will easily be able to update by modifying your Composer requirement, but the app will need thorough testing. This can potentially be time consuming, so unless you really need the new features is unnecessary.

I would highly recommend CakePHP 3.x if you are starting a new project. However, I was just at the CakePHP Conference in New York and the CakePHP Core Developers indicated they would be supporting 2.x for 2-3 years. That time period greatly hinges upon the community to some degree, they are not just going to stop supporting 2.x. any time soon. They are actually going to backport some of the 3.x features into 2.x. They tentatively plan to Release CakePHP 2.7 and CakePHP 3.1 sometime this summer.
I would also ask have you been using 2.x and what is your comfort level with CakePHP? Depends on the size of the project. I haven't made the jump to 3.x yet, haven't had a new project to try it on yet. I have a ton of code for 2.x like bake scripts and plugins that I have customized, so for profitability on a project I still might consider using 2.x.
There will be some learning with CakePHP 3.x especially if you are coming from 2.x, the ORM is awesome, but it much different than 2.x. So you have to weigh your options. They mentioned tools for upgrading from 2.x to 3.x that might help if you start with 2.x and jump to 3.x later. I don't think at this point I would do that, that is more for people upgrading from 2.x to 3.x. that have existing 2.x projects. I would pick a version and run with it.
The the other answers suggest use composer to install CakePHP. I started using composer about 8 months ago with CakePHP 2.x and love it. With CakePHP 3.x, I recommend using composer, like this if it is installed globally: composer create-project --prefer-dist cakephp/app [app_name]

Related

cakephp and phpunit 9

I need a confirmation and your feedback about phpunit version.
In cakephp documention, the 8.5 release is suggested.
I have launched my tests with PHPUnit 9.5.21 and all seems to be OK, but perhaps there are some drawback I've did not seen ?
I use PHP 8.1.5.
Thanks for your feedback about that
The docs aren't always up do date with the latest and greatest stuff in every single aspect, as it kinda needs to cover the major version. As far as PHPUnit goes, version ^9.3 is officially supported as of CakePHP 4.2.
https://github.com/cakephp/cakephp/blob/4.2.0/composer.json#L58-L63
https://github.com/cakephp/app/blob/4.2.0/composer.json#L14-L20

Why should/should not I upgrade to react-native 0.60.0?

Currently, react-native has released version 0.60.0 and it has breaking changes but they have added many native supports in this version.
I am currently working on my 3 projects.
First Project Info
- react: 16.0.0-beta.5 => 16.0.0-beta.5
- react-native: 0.49.0 => 0.49.0
this project containes lots of third party libraries and some of them not event maintained by owners.
Second Project Info
- react: 16.6.3 => 16.6.3
- react-native: 0.57.8 => 0.57.8
this project containes 12 third party libraries.
Third Project Info
- react: 16.8.5 => 16.8.5
- react-native: 0.59.2 => 0.59.2
this project containes 7 third party libraries.
Currently, all three projects are working in debug mode (Didn't try Release mode).
now I want to know from the above-mentioned project which one should I migrate to react-native 0.60.0 (Why)?
What if I don't migrate to react-native 0.60.0?
What are the challenges If I migrate to react-native 0.60.0?
Please guide me.
Suggestions are Welcome.
Here is the specific version timeline that will benefit your app with the trade-off.
v0.59.x
Android 64bit, mandatory for play store publishing.
React hooks
new javascript core engine for android, make your app smoother.
v0.60.x
CocoaPods by default, easier to integrate 3rd party library especially native module!
AndroidX, this will break 3rd party library (even newer one and need time to update it).
Webview and Geolocation is removed.
Hermes javascript engine! Faster startup.
Suggestions
In my opinion, try upgrading to 0.59 is the safest sweet spot because without it, you can't publish your app on play store that requires your app 64 bit compatible. 0.60 can wait, as many of libraries (even newer one!) still not support 0.60.
Obviously project with 0.49 is the hardest one to upgrade because sometimes you need to fork not-maintained-library and fix it by yourself.
Project with 0.57 will be much easier to upgrade to 0.59 because the structure mainly not changes a lot. You can refer to https://github.com/react-native-community/rn-diff-purge
I am not sure about react, but I've had to deal with a similar situation with android SDK, .net core, angular (JS), Xamarin, and Cordova, which I think allows me to make an educated guess, but, beware it a general approach.
So;
upgrading
pros
in line with new features, big fixes, security fixes etc
up to date with latest hardware
small migration blocks (assuming you kept up with the update pase)
cons
possible lose of hardware compatibility on older hardware
need time for proper testing the exact behaviour (test automatisation helps)
not upgrading
pros
saves time now
keep compatibility with older hardware (for now)
your current release is well tested, no surprises
cons
will take more time to migrate in the future
missing out on new features
missing out on stability, security improvements etc.
pre release specific
In your case, since you are dealing with a pre 1.0 version?; you are a typical early adapter. This means you understand the risks involved and are aware of the high update frequency. I would therefore advise to update, but test it well.
... as a general approach ;-)

Upgrading Angular 2.0.0 to 2.x.x

Currently our application is on the Angular 2.0 version.
How important is it to keep updating it as and when Angular releases a new update?
In the changelog i dont see any breaking changes that need to be addressed immediately going from 2.0.0 to 2.4.2.
So is it necessary to upgrade our application from 2.0.0 to 2.4.2? Or should we just wait till there is another big release?
I would suggest upgrading to newer version of major release when:
You came across the issue/bug which was fixed in newer version.
There's a new feature which will come in handy.
Changes positively affecting performance - e.g. AOT compiler which can be a deal breaker to some people, but it might require some code to be rewritten to make it AOT-friendly.
Angular uses semantic versioning. Going from 2.0.x to 2.0.y means that a bug has been fixed. It's usually a good idea to avoid having bugs. Going from 2.0.y to 2.1.0 means that a new feature is available. You might want or need to benefit from this new feature.
You won't have any breaking change until the next major version, which will be 4.0.0 (there won't be a 3.x version, in order to align angular and its router versions)
As mentioned on this link under Best Practices Section
Best practices
Keep current with the latest Angular library releases. We regularly update our Angular libraries, and these updates may fix security
defects discovered in previous versions. Check the Angular change log
for security-related updates.
Don't modify your copy of Angular. Private, customized versions of Angular tend to fall behind the current version and may not include
important security fixes and enhancements. Instead, share your
Angular improvements with the community and make a pull request.
Avoid Angular APIs marked in the documentation as “Security Risk.”

Recess PHP framework Vs CakePHP

I haven't taken a look at Recess PHP Framework in a while, but for those that have experience with both frameworks I ask this question: What features does Recess offer over CakePHP 2.x?
Most of the code in the Recess github repository hasn't seen an update in 3 years, with the latest commit a year ago. The forums are offline and their last blogpost dates back from 2010. So I'm not sure if Recess is actively developed anymore, which might become a problem in the long run.
That said, Cake has quite a lot of developers, is backed by a foundation and receives regular updates. Also Cake's ecosystem of plugins, code snippets, etc. is bound to be more extensive compared to Recess.

Should I upgrade my project from Cake 1.2.5 to CakePHP 1.3.0?

My web project (to be launched in a few months) is currently using CakePHP 1.2.5 / PHP 5.1.6 / MySQL 5.0.77.
From a performance point of view, is it a good idea to upgrade to 1.3?
Will it make it easier to later upgrade to the (PHP5-only) CakePHP 2?
I'd say it depends on when you expect to get your site out the door. 1.3 is currently in alpha status and probably won't be officially stable for a while. While the changes being made between 1.2 and 1.3 shouldn't have a huge impact on the overall stability, the new features being put in might still be buggy. The question is, is there anything in 1.3 that you absolutely need now?
If you want to release your site soon on an unstable version of 1.3, you need to make sure through a lot of testing that the parts you're using are performing as expected. If your project will evolve over time together with 1.3, let's say over the next 6 months or so, and you continuously keep updating, you'll probably be in better shape. For example, I developed a project on the 1.2 beta and there were a few bugs in Set, which tripped me up, but got ironed out 'till the final release.
For a long-term project, I'd prefer the 1.3 branch, while for a near-future release I'd stick with 1.2.5 for now. You can keep an eye on the Migration Guide to avoid API calls that will be deprecated in 1.3, to allow for an easier later upgrade.
I think an upgrade is always a better opition IF you have time to do it. Im not into CataPHP but, i would do any upgraded if i have enough time before the release.
i'd upgrade early situation allows. if you haven't you might want to start using the cakephp/simpletest test to make sure things work just fine.
i took my time upgrading from 1.1 to 1.2 and had a lot of 'fun' going through my codes. :)

Resources