[wp-hackers] concatinating PHP code files

Chris Jean gaarai at gaarai.com
Fri Mar 26 03:19:28 UTC 2010

Completely agree Jon. You'll never get a full picture of what is going 
on unless you look at the code as the code is structured.

The best thing to do is learn how to do the following:

    * Search through code using grep or ack as already stated in this
      thread. Doing this helps you understand how other coders structure
      code, functions, etc.
    * Use print_r or var_dump (depending on preference) to inspect data
      structures (classes, arrays, etc). This helps you understand how
      information that is being passed around is structured.
    * Learn to use debug_backtrace to be able to trace exactly how a set
      of code was called. This will show which functions were called,
      with what parameters, and from what file the call originated from.

This isn't something that can be sped through or simplified. There are a 
large number of files with a very large set of functions. If you want to 
understand it, you need to search through it, read it, and experiment 
with it.

Chris Jean (AKA gaarai&  chrisbliss18)
Coder for http://ithemes.com/

On 03/25/2010 04:58 PM, Jon Mihkkal Inga wrote:
> I still can't get why you want to do this or how it would make anything
> easier. I doubt that having a bigass file to scroll up and down will satisfy
> your curiosity. The way to do it is to pick a function and go backward
> through all its callers or forward through all its calls. If you make a
> single file from all code chances are you'll just end up more confused
> 'cause you won't know which function came from what file originally if you
> don't spend a lot of energy designing the merging script. I suspect that
> energy is better spent searching the code manually in the first place. Get
> yourself a tabbed code editor with file searching capabilities. I use
> notepad++<http://notepad-plus.sourceforge.net/>, simple yet flexible with
> auto completion and goodies.
> cheers
> /jomik

More information about the wp-hackers mailing list