We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

combine Phalcon + legacy php

Dear experts,

Is it possible to have Phalcon + legacy php code for website? I have a legacy php website and could like to new features in Phalcon and convert legacy code to Phalcon MVC framework later.



Where is the question? You can use all what do you want. If you need mvc in phalcon migrate you application to it. It is easy task for 1 day.

If you want to use Phalcon DB it is a hard task for migrate.

i think, for first rewrite legacy structure to phalcon framework and use what do you want ^^

edited May '14

the most popular approach in use cases like yours is just give away all the legacy code, write

git init

and create a new phalcon project with the fresh air!

edited May '14

@Vastly and after git init then

cd .. && rm project
mkdir project && cd project && hg init



Дмитрий Пацура,

Thanks for your help. I work on rewrite legacy code to phalcon. I do not understand about 1 day's work part. Is it possible to run application with mix of phalcon and legacy code?

Yes, Phalcon and legacy code can work together. Phalcon is just an extension of PHP, so just like how getimagesize() or array_reverse() are always available everywhere, Phalcon functionality is always available everywhere.

With that said, it does take a little bit of set up to properly initialize a Phalcon based application (ie: setting up the database connection, etc).


@quasipickle: Thanks. If I use vokuro or invo as my base phalcon,
Where should I add code to support legacy path (for example localhost:/style/test ) ?