views:

30

answers:

1

Hi everyone,

I'm currently learning Zend Framework and now I am looking for a way to integrate it into an existing website. This website is coded in an extremely complex spaghetti way, and I am hoping that it will be easier to read by integrating it into Zend and slowly refactor it. How could i run legacy code and the zend framework + mod_rewrites side by side?

Greetings,

Bas

+2  A: 

Since you don't give any information on how your current site is structured, there's absolutely no way to answer this question.

Some guidelines though : make sure you first tackle routing, you could probably solve this by including your current scripts in the relevant controller actions. After routing is ok, you can have a look at rewriting the interactions so you use ZF's Zend_Request/Response and afterwards start integrating other Zend Framework functionality (ie. Zend_Acl/Zend_Auth for user permissions and authentication).

BTW It might be a lot easier to start from scratch and do a clean rewrite, picking up pieces of existing code as you go...

wimvds
If you're already using rewrite rules then it's quite possible that using ZF will be a pain in the ass (or almost impossible). And even if you're not using rewrite rules at the moment, you probably still have to change links from your "old code" to parts of the code you have already rewritten to make your slow integration approach work. So in the end, it might be better to do the routing in one go, unless you want to spend a lot of time rewriting both old and new code and test if everything still works...
wimvds