Logging what php files have been executed

  • Sumen
  • Proficient
  • Proficient
  • User avatar
  • Posts: 421
  • Loc: Rochester or Albany, NY

Post 3+ Months Ago

I sometimes have to maintain a very large php/flash application. The code is something we inherited a while ago and is definitely a big ball of mud: http://en.wikipedia.org/wiki/Big_ball_of_mud and theres no one around that originally developed it.
There's lots of almost duplicate files in lots of nearly identical directory structures, and I am fairly certain a large portion of the files aren't being used (this being said they are at the least...scattered between these directory structures :( ). The application is large, and a QA pass is not a small task. That being said It occurred to me that if I could log what files an apache server was executing / including in the php files, it would be a good start in whittling down this mess. Anyone know anything that might help?

Also, I am still searching for a good PHP Editior. It seems that it'd be possible to have a IDE which ran a server which loaded your files, and then allowed for some code completion, or at the least a way of finding the definitions of functions and variables... I often find myself chasing a function call for quite a crazy while... just to find it and forget why I was looking for it (Have to do a stack trace of my thoughts on a notebook :P). Though it seems totally possible to do this (since php itself...i suppose... has to do it) I haven't found an editor that seems to. Anyone know?


Thanks for any help
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Do you guys have an opcode cache (for instance xcache) running ?
I know xcache has an administrative UI where you can see the PHP files that have their opcode cached. A files presence in the cache with a timestamp in the recent past is a good indicator that the file gets used.
  • Sumen
  • Proficient
  • Proficient
  • User avatar
  • Posts: 421
  • Loc: Rochester or Albany, NY

Post 3+ Months Ago

I'm actually not sure of the specifics of the setup, Ill find out. I'm guessing that there should be an opcode cache of some kind, ill find definitely look into it thanks.

Just so I understand a little bit better... I would've expected when php pages get cached, for it not to necessarily cache the pages that were included separately... since in php it seems like a require is sort of like typing the code right there in the page...and it seems like it would cache the particular set of requires as a whole.

What I mean is... if someone when to index.php, and index required several other php files, would it show all those other files or just index.php?

Either way I guess some tests at what its logging are definitely in order
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Here's an example of what you'll see with xcache. Other opcode caches will likely vary.
Attachments:
xcache-admin.gif

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 151 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.