1,105,625 Community Members

Best way to dive into an existing complex php project

Member Avatar
theprofoundgeek
Newbie Poster
8 posts since Oct 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello Guys!

I have just inherited a huge mammoth php project, which is not quite organised. Few of the files are of 25K+ php lines of code. Several sections of code are redundant across the project. Several files are imported into several files... My job is to strip many of the unwanted features of this project. I am not a php guy, but I am comfortable with programming, so that should not be a problem.

Can you folks please tell me what should be my strategy to work with project?

I have the following in my mind.

(1) Use eclipse, to navigate around the project.
(2) Use Xdebug trace the execution and step into the code.
(3) Make Xdebug to dump the line numbers of code executed and write a shell script to extract those lines, so as to isolate the code required by me.

I request everyone to share there experience and strategies in such projects. At the end of the discussion, I would summaries the discussion so that anybody else can get the head start by just reading that.

Thank you!

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

Apart from XDebug, I've used log4php on occasions to just log an application's flow to a textfile. This will help you in making a map of the files/functions, and what is called in what order.

If you come across a piece of code that is repeated, make a new file and put the function there, in your own coding style and remove the others. Step by step rebuilding the code in your own style will help make things simpler in the end, in my experience anyway (whether it is function or OOP).

If not there already, implement decent fault handling and logging.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: