H
H
hOtRush2013-12-16 23:39:31
CodeIgniter
hOtRush, 2013-12-16 23:39:31

Is there a solution that allows one application to run from two frameworks (Codeigniter + Phalcon)?

Faced the following problem. There is a project filed on codeigniter. And a number of tasks from bugfixes about new features.
The wording of the customer's wishlist sounds something like this: "we make bug fixes in codeigniter, and we make new features on phalcon." I can’t find a suitable solution for how one application can work from two frameworks. It seems to me that this is inappropriate. Can someone please suggest a solution?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
_
_ _, 2013-12-16
@hOtRush

This is nonsense of the customer, to be honest.
The only more or less reasonable option for an application to work on two different frameworks is to separate them by frameworks at the reverse proxy routing level.
Like, if we have links /gallery/my-awesome-gallery, then we do an upstream to 127.0.0.1:8889, where we have Phalcon, and all other links to 127.0.0.1:8888, where CI.
Writing code for two frameworks in one file is hell, it will be impossible to support it.

P
Pilat, 2013-12-29
@Pilat

Probably, the customer meant the following: "Your CodeIgniter works very slowly, rewrite everything except the GUI (json requests, for example) on Phalcon" - then it's clear where this requirement came from, and it's clear how to fulfill it.

D
Davert, 2013-12-17
@Davert

Do the refactoring step by step. First one feature, one controller, then the second controller, etc. If your data model is stable (only bug fixes), then first transfer all models and start making controllers. How to share at the server level - decide for yourself. I would just change the server routing settings: some urls to falcon, some to CI. Of course, the question of sessions remains, but I think it can be completely solved if the sessions are stored in one place.
BUT! And don't try to start making the transition without tests. It's just not worth it. Write tests for CodeIgniter, through, for example, Codeception with the PhpBrowser module, and then, as the application migrates, run these same tests on a new application with Falcon. That is, ideally, your tests should work the same regardless of which framework is used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question