Jump to content


Photo

Best framework for integrating rubbish code?


  • Please log in to reply
4 replies to this topic

#1 johnsmith153

johnsmith153

    Advanced Member

  • Members
  • PipPipPip
  • 704 posts

Posted 07 March 2013 - 02:20 PM

I have a site written in bad code. Everything is all thrown onto one page. The PHP is at the top (above HTML output) and the rest is at the bottom, but that's as good as it gets.

 

Which framework would allow integration of this site the best (or any advice as to doing this)?

 

Of course the whole lot could be re-written and of course I could just decide not integrate it, but I'm looking to improve all the client side stuff, but maybe just drop the PHP into one 'processing' file. The benefit to this I see is that I can gradually add improvements to the site and make use of the framework as I do it (and save time now). Over time the rubbish code would no doubt be reduced.

 

Also, I may re-do all database interaction. So the idea would be to start as though creating a completely new site (using the framework), but when it gets to writing PHP I would save a lot of time by just calling the flat-PHP code already produced, maybe changing one or two things though (e.g. DB interaction).

 

I'm sort of looking at learning Symfony2, so I suppose the question also is could I learn Symfony2 and then integrate this rubbish site later and kill two birds with one stone, or is Symfony2 not very good for integrating rubbish flat-PHP code (and maybe another framework is a better idea)?

 

The idea is to modernise it, but not re-do it - if possible.

 

Thanks for any advice.



#2 Hall of Famer

Hall of Famer

    OOP Fanboi

  • Members
  • PipPipPip
  • 292 posts
  • LocationIthaca

Posted 07 March 2013 - 07:15 PM

Id strongly recommend you to overhaul your script before applying them into frameworks, since its difficult to convert a spaghetti code into a neatly designed structure of script in one step. But anyway if you want to do it fast, Codeigniter seems to be the framework that integrates with non MVC script the best. 


Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

oophp-logo-w151.png

    


#3 Christian F.

Christian F.

    Advanced Member

  • Gurus
  • 3,055 posts
  • LocationNorway

Posted 08 March 2013 - 07:03 AM

No, no and no. CI is one of the worst frameworks to use, especially for learning purposes.

What I would recommend you do to, John, is to find a small and light-weight framework. One which you feel comfortable with, and then work to rewrite your logic to it. Laravel or Symfony 2 are some of the most commonly recommended frameworks, and Yii is another candidate. You can find a list of others at Wikipedia.

Edited by Christian F., 08 March 2013 - 07:04 AM.

Keeping it simple.

#4 johnsmith153

johnsmith153

    Advanced Member

  • Members
  • PipPipPip
  • 704 posts

Posted 08 March 2013 - 09:22 AM

Thanks for the advice. I still think Symfony 2 is a good choice, although I was under the impression Symfony2 wasn't considered light-weight. Regardless, I like what I see so far.

 

John



#5 annaharris

annaharris

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 01 May 2013 - 06:46 AM

I am agreed with Hall of Famer, Codeigniter works perfectly for our requirements.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com