Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4238580
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:55:23+00:00 2026-05-21T02:55:23+00:00

I have been handed over a large undocumented code of a application written in

  • 0

I have been handed over a large undocumented code of a application written in php as the original coder went AWOL. My task is to add new features but I can’t do that without understanding the code.I started poking around. honestly, I am overwhelmed by the amount of source code. I have found:

  • Its well written based upon MVC architecture, DB persistence, Templating & OOP
  • modular, there is concept of URL based routing,basic templating
  • Uses custom written php framework which has no documentation.And there no source control history(oops!)
  • there over 500 files, with each file containing hundreds of line of code. And every file has 3-4 require_once statements which include tons of other files, so its kinda hard to tell which function/class/method is coming from where

Now I am looking for some techniques that I use to understand this code. for example, consider the following code snippet:

class SiteController extends Common {

private $shared;
private $view;


protected function init(){


    $this->loadShared();
    $this->loadView();


}

private function loadShared(){
    $this->shared = new Home();
}

private function loadView(){
    $this->view = new HomeView();
}

I want to know

  • where HomeView() & Home() are defined? Where does $this->shared & this->view come from? I checked the rest of the file, there is no method named shared or view. so obviously, they coming from one of hundreds of classes being included using require_once() But which one? how can I find out?
  • Can I get a list of all the functions or methods that are being executed? If yes, then how?
  • this class SiteController overrides a base Common class. But I unable to find out where is this Common class is located. How to tell?

Further, Please share some techniques that that be used to understand existing code written in php?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:55:24+00:00Added an answer on May 21, 2026 at 2:55 am

    First, in this kind of situation, I try to get an overview of the application : some kind of global idea of :

    • What the application (not the code !) does
    • How the code is globally organized : where are the models, the templates, the controllers, …
    • How each type of component is structured — once you know how a Model class works, others will typically work the same way.

    Once you have that global idea, a possibility to start understanding how the code works, if you have some time before you, is to use a PHP Debugger.

    About that, Xdebug + Eclipse PDT is a possibility — but pretty much all modern IDEs support that.

    It’ll allow you to go through the generation of a page step by step, line by line, understanding what is called, when, from where, …

    Of course, you will not do that for the whole application !

    But as your application uses a Framework, there are high chances that all parts of the application work kind of the same way — which means that really understanding one component should help understanding the other more easily.

    As a couple of tools to understand what calls what and how and where, you might want to take a look at :

    • The inclued extension (quoting) : Allows you trace through and dump the hierarchy of file inclusions and class inheritance at runtime
    • Xdebug + KCacheGrind will allow you to generate call-graphs ; XHProf should do the same kind of thing.
    • Using your IDE (Eclipse PDT, Zend Studio, phpStorm, netbeans, …), ctrl+click on a class/method should bring you to its declaration.

    Also note that an application is not only code : it often find very useful to reverse-engineer the database, to generate a diagram of all tables.

    If you are lucky, there are foreign keys in your database — and you’ll have links between tables, this way ; which will help you understand how they relate to each other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large database with over 150 tables that I've recently been handed.
I have been given the task of internationalizing a large client-server application. The remit
I have been handed over a project which has an availability calender in it.It
Recently, i have been handed over with an ash report from DBA. To me
I have just been handed a huge project for an application that must run
I have a list on when items have been handed out. The table has
I have been tasked with porting a large Java codebase to the Android platform.
We have been handed a set of test sertificates on smart cards for developing
I have a problem I've been dealing with lately. My application asks its users
I've been handed over a web applicaion to which I need to make some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.