views:

84

answers:

4

Hi,

I currently work with an in-house CMS which was developed long before I joined the company. It's full of procedural spaghetti code which mixes SQL, PHP and HTML altogether, often on the same line. As you can imagine, it can get very difficult to follow and understand.

I would like to integrate a mature framework in order to make repetitive tasks easier to manage, however I'm slightly overwhelmed by the choice available.

Ideally, I'm looking for something that will allow me to simply include a class library and use only the components I need (mostly - ORM, Forms, and Pagination)

Given the nature of the existing system, I think that moving over to a full MVC approach would be prohibitively complicated.

Can anyone recommend a suitable choice?

Any advice appreciated.

Thanks

A: 

Try CodeIgnitor

Mithun P
You should improve your answer. The name is misspelled, no link and no reasons why given.
Daff
+2  A: 

There is much less standalone component libraries than full stack frameworks.

Consider

  • PEAR, Zeta Components (formerly ezComponents) or Zend Framework.
  • Doctrine or Propel for an ORM
  • Symfony Components for DI and Templating (if needed)

A framework is no guarantee for better code though. It's how you use it. Since this sounds like a major refactoring you will also want to look into PHPUnit. If you are going to replace existing functionality with that from the frameworks, you have to ensure you don't break anything in the process. This is where UnitTesting will help you tremendously, because once you have a test for a functionality, you can rerun it after you refactored the code and be sure it still works as expected.

And to provide the standard Links to the framework topic:

Gordon
+1 for pointing out good libraries that don't require you to drink all the cool-aid. I would start by looking at ZF, and possibly Doctrine if you want heavy-duty ORM.
timdev
A: 

This is not going to be an easy task. In most cases, when porting an application to some framework, you have to re-write it to a great deal.

You can have a look at various stable php frameworks and decide to choose one as per your requirements.

Sarfraz
A: 

Search around a bit on SO and see what has been discussed in the past. Plenty of threads like the following cover the major frameworks:

http://stackoverflow.com/questions/249984/php-framework-decision-analysis-paralysis

http://stackoverflow.com/questions/2648/what-php-framework-would-you-choose-for-a-new-application-and-why

http://stackoverflow.com/questions/1046091/which-php-framework-is-right-for-this-project

I'm in the camp of 'In most cases, a PHP framework isn't necessary and it only adds complexity.' cletus said it well here.

labratmatt