Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inherited a PHP nightmare, where to start? [closed]

I've inherited a PHP project that's turning out to be a nightmare. Here are the salient points:

  1. All the original developers have left
  2. The code has no version control
  3. All development and testing was done on the live server by renaming and editing the PHP files. There are multiple copies of each file index.php, index2.php, index3.php etc. and it's unclear which files are really being used
  4. There are multiple includes in each file to files that include other files that include other files, etc.
  5. There have been a multiple developers on the project that each had there own way of doing things. For example, there is a hodgepodge of JavaScript frameworks, some database queries use SQL, others an XML interface and others call procedural functions in the database.

Because of all of these problems, development is frustratingly slow. Besides venting my frustrations to Stack Overflow, any recommendations on how to get started on this mess? I'm fairly new to PHP development myself, but it seems like setting up some kind of development environment so that changes can be tested without breaking the live server is the first step. Any tips on how to get started here? What is a typical way to do testing? Setting up a local version of the site on my desktop seems like a lot of work (server is Linux, but desktops here are Windows). Can I create a subdirectory on the live server for testing, or..? What about the database?

Secondly, is there some kind of profiling I can enable to track which files on the server are actually being used? I'd like to delete the renamed copies of things that aren't actually being included. Even better, is there a way to tell which parts of a file aren't being executed? There are lots of copied functions and garbage in that I suspect aren't being used either. Similarly, for the includes, any tips on straightening out the mess?

Well, I'll stop venting here and throw myself at the mercy of everyone here. :)

like image 279
gerdemb Avatar asked Dec 09 '08 18:12

gerdemb


1 Answers

  1. Before all else, get the files in version control as is. Do not proceed past #1 until it is done.
  2. Establish a testing environment.
  3. Clean up the files
like image 136
Scott Bevington Avatar answered Oct 04 '22 01:10

Scott Bevington