Running Yii framework along with current codebase

Hi guys,

My current code base is hand-written sql. It is very very terrible and I do not have time to rewrite the whole thing. So, I think what if I can build new feature of my app using Yii framework.

For example: - run current code base - run Yii framework

Please let me know if it is feasible. If yes, please give me a brief description on how to do it. I am using Apache.

You need to know, what you want in the end and at least have a rough idea about the goal you want to achieve. With a problem description like this it’s very hard to give you any tips at all. Yii is cool - but that does not mean, you don’t have to think on your own anymore :)

Thanks for reply, Mike.

My end goals is to ‘infect’ Yii MVC to my current code base. Building from scratch is too much to handle and I have to keep developing new features .

My idea is to ‘infect’ my current code with Yii, and I will work my way to convert everything to Yii. Starting by developing new features using Yii within the current code base.

I’ve done a little of research and find out that I can have ReWrite rule in .htaccess to redirect to yii index and hopefully Yii will pick it up next.

That’s my idea.


Your approach sounds reasonable. With mod_rewrite you can migrate existing pages step by step over to Yii. If you really have to, you can even include Yii in your current code (e.g. to check user guest state):