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

Update to the current version of CakePHP and adapt the code to work with it. #1122

Closed
ckjpn opened this Issue May 1, 2016 · 8 comments

Comments

Projects
None yet
5 participants
@ckjpn
Copy link

ckjpn commented May 1, 2016

Perhaps it might be a good idea to update from Version 1.3 to Version 3.2.

I know it would involve a lot of time, but in the long run, it may help save total man hours, assuming that we'll be getting more and more developers volunteering their time to help.

I think potential developers for the Tatoeba Project would likely be more interested in spending time to learn how to use the current version of CakePHP rather than an old version, since they could apply what the learn to possible other projects that they may want to develop for themselves in the future.

I know that I personally would be more interested in helping if we were working with the current version of CakePHP.

http://cakephp.org

I'm not sure, but additionally very likely the newer version of CakePHP is more efficient.

@ckjpn ckjpn added the enhancement label May 1, 2016

@halfdan

This comment has been minimized.

Copy link
Member

halfdan commented Dec 27, 2016

CakePHP 3.3 has since been released. This is certainly a good idea to also take advantage of all the new developments in cake.

@trang

This comment has been minimized.

Copy link
Member

trang commented Dec 28, 2016

There's a few things to consider:

  1. How much effort would this take?
  2. What exactly would be the benefits?
  3. Do we want to continue with CakePHP at all, or move to another framework?

I don't have clear answers to these questions.

I don't reject at all the idea of upgrading, but I would like not to do it for purely "marketing" reasons, because working on the latest version just sounds more attractive. We need to look at the project's needs, and choose according to that.

I'll be more than happy though, if someone wants to try plugging the newest Cake version into Tatoeba's code, and see how things run, get an overall idea of how much time it'd take to migrate, what would be better, what would be worse.

@zachleigh said to me he'd be interested to have a look at this. But he's also interested to work building an API for Tatoeba, which (to me at least) would be a higher priority. Probably he'll be focusing on that.

On my side, for the next six months or so, my focus is on the UI, on finishing #1180. So this upgrade would definitely not be a sub-project I could take on.

@halfdan

This comment has been minimized.

Copy link
Member

halfdan commented Dec 29, 2016

These are all very important questions.

  • How much effort would this take?

I just attempted an upgrade to CakePHP 2.x, from there the upgrade path becomes easier. The upgrade will certainly require a significant amount of work but will also help structure the app more. A number of parts in the current app could be componentized and hence better testes / reused.

  • What exactly would be the benefits?

The usual "better performance" / "better API" are obvious arguments. The latest 1.x release was in 2011. Since then many features have been added to both PHP and Cake. CakePHP 3.x comes with a new ORM that could help with deeply nested relationships. It uses Composer to do dependency management, comes with a CLI to do most development operations (create new controller, tests, model, ...). I've certainly not yet developed a deep enough understanding of the codebase to argue for the benefits of upgrading CakePHP. One of the things that it will help with however is attract more contributors who seek to work on a modern open source project - Piwik saw a steady decline in contributions while it clung onto older PHP versions and has since gained much more popularity after migrating the codebase to PHP > 5.3 and improved its tooling.

Seeing that tatoeba seeks to apply for Google Summer of Code I can only imagine that Google isn't very keen on funding a project that is built on top of a 5 year old framework.

  • Do we want to continue with CakePHP at all, or move to another framework?

As a new contributor I can certainly not answer this question for you. At work I'm a Rails developer and had long abandoned PHP for its lack of good tooling, package management and weird idiosyncrasies. I however am a strong believer in refactoring existing code instead of completely abandoning it and beginning from scratch. Not only do you loose a lot of time building a project from scratch, but you also risk loosing long time contributors and their knowledge. CakePHP is a perfectly fine solution and I haven't come across an issue here that suggests it would be worth the time investment of replacing it entirely. As for PHP, the reason why I'm interested in looking at the language again is because it has in recent years played catch-up and is finally in a state where both tooling and language features have reached the state of a modern programming language.


All this said, I am more than happy to talk to @zachleigh and spend a weekend in January on upgrading this app to a more recent CakePHP release. @zachleigh Are you still interested in doing this?

@zachleigh

This comment has been minimized.

Copy link
Contributor

zachleigh commented Dec 30, 2016

@halfdan Yes, I'm still interested in doing an upgrade. Time is a bit of a problem at the moment, but I could probably find a weekend in January.

@trang

This comment has been minimized.

Copy link
Member

trang commented Jan 3, 2017

@halfdan first, thanks for your valuable input on this issue and thanks for volunteering for this :D

To migrate to 2.x without too much merge conflict headache, we'll have obviously to merge the remaining pull requests. Should be done for this weekend, hopefully.

As for other works in progress:

  • @jiru, besides the PR about the audio, do you have anything else ongoing for which you may want to submit a PR before we undertake a framework upgrade?
  • @zachleigh, I think on your side there's just this thing about the pagination (which I haven't taken the time to look at yet). I'm assuming we don't need to implement this before the upgrade? But let me know if we should. Could be something we can look at this weekend.
  • On my side, I have nothing important. Just some local branch where I'm trying to redesign the homepage, but it's just a draft.

In terms of planning, if we want to get this done in January, I'd see something like this:

  • this weekend: merge the remaining PR's.
  • until Jan 14-15: spend some time refactoring stuff to make the upgrade easier?
  • until Jan 21-22: work on the upgrade, deploy on dev.tatoeba.org.
  • until Jan 28-29: have users tests if everything works as before, fix stuff, then deploy on prod.

Sounds good, or too short timing?

@jiru

This comment has been minimized.

Copy link
Member

jiru commented Jan 4, 2017

@jiru, besides the PR about the audio, do you have anything else ongoing for which you may want to submit a PR before we undertake a framework upgrade?

No, I’m not working on anything else.

@trang, I don’t think refactoring will help much migrating because it seems 2.0 is more about new namings and new API than anything else. I’m not sure if any plan is worth making because you never know the kind of problems you’re going to face. I remember I had to fix a very weird bug when we upgraded from 1.2 with the help of loolmeh, which was of course totally unexpected and took me quite some.

Note that I had to make some changes to our copy of CakePHP 1.2, but you can safely ignore them. I reported the Arabic plural problem to the CakePHP team and they solved it another way in CakePHP 2.6.

@zachleigh

This comment has been minimized.

Copy link
Contributor

zachleigh commented Jan 4, 2017

@trang No, the pagination thing does not need to be finished before we do the upgrade.

The timing is fine with me.

@trang trang added this to the 2017-01-28 milestone Jan 13, 2017

@trang trang referenced this issue Feb 9, 2017

Merged

CakePHP 2.9.4 #1395

@trang

This comment has been minimized.

Copy link
Member

trang commented Feb 14, 2017

The major features have been migrated successfully from 1.3 to 2.9 so I'll be closing this issue. I'll create another one for the upgrade of CakePHP from 2.9 to 3.x when the time comes. We'll first need a couple of months to stabilize this upgrade and do some clean up before we can consider moving to the next upgrade.

Thanks again @halfdan for your work on this.

Just for the record:

@trang trang closed this Feb 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment