Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CakePHP 2.x upgrade to 3.x #2350

Closed
rhaist opened this issue Jul 23, 2017 · 10 comments
Closed

CakePHP 2.x upgrade to 3.x #2350

rhaist opened this issue Jul 23, 2017 · 10 comments
Labels
security This issue involves a security feature T: enhancement Type: enhancement. This issue requires improving an existing feature

Comments

@rhaist
Copy link

rhaist commented Jul 23, 2017

As announced by the CakePHP Team with the latest 2.x release[1] they will now focus on the 3.x release and feature cycle.

I tested the provided 2to3 upgrade tool today[1] and it seems to do work for the current 2.4 branch. As this would be a big change it has to be prepared, tested and coordinated by the MISP project maintainers and not by a PR.

The 3.x upgrade would probably help in the ongoing test coverage challenges (REF: #98) and allows/simplifies upgrading some other dependencies like bootstrap.

[1] https://github.com/cakephp/cakephp/releases/tag/2.10.0
[2] https://book.cakephp.org/3.0/en/upgrade-tool.html

@rhaist
Copy link
Author

rhaist commented Jul 23, 2017

I ran bin/cake upgrade all ../MISP/app on a fork.

You can have a look at my branch over at:
https://github.com/SleuthKid/MISP/tree/cakephp-upgrade-3.x

@adulau
Copy link
Member

adulau commented Jul 23, 2017

Thank you for looking into this.

There will be a major release (and maybe some additional smaller releases later) soon of MISP to include the current objects branch. So it's foreseen but not before this major release.

Quickly looking into your branch, I'm wondering about such changes which mangle the code:

rhaist@7700476#diff-6026820ed6cbb17b5c9eb8a4c9df3c13R2345
rhaist@7700476#diff-6026820ed6cbb17b5c9eb8a4c9df3c13R2640

Maybe the conversion script needs to be reviewed?

If you want to test it, a PR could be interesting to see if Travis succeed with such automatic conversion
and if the basic API test works.

Thank you.

@adulau adulau added T: enhancement Type: enhancement. This issue requires improving an existing feature security This issue involves a security feature labels Jul 23, 2017
@Rafiot
Copy link
Member

Rafiot commented Jul 23, 2017

in the todo list: making sure a user running git pull after the upgrade doesn't run into issues (not only new installs have to be working)

@adulau
Copy link
Member

adulau commented Jul 23, 2017

@Rafiot Indeed very good point. Upgrade is a significant part of our user base.

@rhaist
Copy link
Author

rhaist commented Jul 23, 2017

@adulau you are right. The upgrade tool parser does not seem to recognize that the "use" keyword is in a string variable. I will try to solve this upstream. I will look into the parsing errors and fix them manually and prepare a PR of the branch. I do not expect it to just work :)

In some other matter, the usage of phpfmt with cakephp profile or some other formatter would ease transitions in the future. CIRCL and MISP most probably qualify for phpstorm educational licensing[1].

[1] https://www.jetbrains.com/phpstorm/buy/#edition=discounts

@adulau
Copy link
Member

adulau commented Jul 23, 2017

@SleuthKid Which coding style do you use PSR2 or PHPCS? Not sure if there is a consensus on this. Especially if you want to diff on the long-run the whole project. @iglocska any recommendation?

@rhaist
Copy link
Author

rhaist commented Jul 23, 2017

@adulau as I am not experienced in PHP programming I can not tell you which standard is most widely adopted. php ../phpcbf.phar -p -v app seems to fix a lot of indentation stuff but generates trailing whitespace in some corner cases. phpfmt sadly is now closed source but can be used from sublime3 as plugin.

@rhaist
Copy link
Author

rhaist commented Jul 23, 2017

@adulau http://cs.sensiolabs.org/ does the best job in my fmt tests.

@rhaist
Copy link
Author

rhaist commented Sep 11, 2019

Any updated plans on this. This is over 2 years now and CakePHP is close to moving to version 4.x while MISP still uses an old 2.x version. As most of the MISP core functionality is dependent on CakePHP I see a ticking time bomb here.

Upstream reference: https://bakery.cakephp.org/2017/06/23/upcoming-cakephp-roadmap.html

@iglocska
Copy link
Member

It is on our roadmap and we're working on it. Announcements coming at hack.lu/misp summit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security This issue involves a security feature T: enhancement Type: enhancement. This issue requires improving an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants