SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fully expanded PHP source code file

    Does anyone know of an existing tool or code snippet that, given a PHP source code file, replaces the include(), include_once(), require(), require_once() single line entries appropriately with the actual text of those files so that you could see (and run) in a single file the complete code including all functions definitions for a page?

    I'm looking at a reasonably large PHP application at the moment & its very difficult & time-consuming to read through the code when significant pieces of code, variable and function definitions are buried in a number of different files in a number of different locations throughout the file system.

    It would be nice if it also handled nested includes and pretty-printed the code like the PHP functions show_source() & highlight_file() do!

    Thanks in advance,
    John

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just get a php ide. I don't think any of them expand things into a single file for you, but that would suck anyway. You can do cool stuff like right click on a function name and have it navigate you to the function declaration, opening the file and going to the line. A lot of other helpful stuff. Read their docs, it's time well invested.

    I've been pretty happy with netbeans(it can do php pretty well), but I'm sure most of the others offer similar functionality.

    edit for lol- thier website is dumping database errors right now

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,172
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    I know what you mean about following code. I've been trying to track down the cause of some unserialize() errors in WordPress for a while. As complicated as OOP can be, I'm not sure seeing everything consolidated into one big file would be much easier. That said, you could take a look at the Eclipse IDE too, although IMHO Netbeans has matured a lot since when I used it to play with Java a while back and probably is comparable to Eclipse by now.

    I never thought of using it for PHP for some reason. Hmmmm, maybe I can get a plugin for it (4.0 my d*** Win 98 OS!)?

  4. #4
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's great - thanks guys!
    Netbeans it is then ... a voyage of discovery!
    Cheers,
    John


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •