Any tools or tips on fast PHP refactoring?

203 views Asked by At

Our current "in-house" newsletter system is just PHPlist with the company logo slapped on it. I am given the task of adding various features into it, but the code of PHPlist is just monolithic and hard to break down. I would like to break it down to more manageable pieces first, but what I aim to do ultimately is to rewrite the whole UI and logic from scratch with CodeIgniter and ExtJS, keeping only database compatibility with PHPlist.

I can just say "screw it" and write a new system completely from scratch, but I would like to keep as much of the original PHPlist behaviour as possible, therefore, the first step I have to do is to understand where all the features of PHPlist are buried first, and diving dozens of files with hundreds to thousands lines of uncommented PHP with no apparant structure is not fun. :(

2

There are 2 answers

1
Phil Lello On BEST ANSWER

My gut reaction is that if the code is that bad, then you should just bin it. Often the best approach with write-once-read-never code.

Before you do:

  • Talk to the users, and find out what functionality they use
  • Write a spec, and get them to sign off
  • Implement the new system, and wave the signed-off report in peoples faces when they say 'I used to be able to do XXX'

And if there's any way you can get it across to the business, tell them RSS and ATOM is far better than bulkmail.

0
bumperbox On

if its just internal have you looked at other options, may save you time and money

Eg MailChimp.com Store up to 2,000 subscribers. Send up to 12,000 emails per month. No expiring trials. No contracts. No credit card required.