PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Dec 10, 2018 1:56 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri May 29, 2009 4:57 pm 
Offline
Forum Newbie

Joined: Wed May 27, 2009 1:09 am
Posts: 4
I'm working on trimming away old and unused scripts from a rather large project. The only problem is that we have a real tangle of include and require statements.

I can gather statistics from Apache's log files to help identify pages that aren't being directly accessed by users, but when one file is included by another, that's all being done by PHP, right? Is there any way to create a log of the files that PHP accesses?


Top
 Profile  
 
PostPosted: Fri May 29, 2009 5:14 pm 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com
A combination of register_shutdown_function() to update a log file, and get_included_files() to build a list of which files were included should do the trick.


Top
 Profile  
 
PostPosted: Fri May 29, 2009 5:44 pm 
Offline
Forum Newbie

Joined: Wed May 27, 2009 1:09 am
Posts: 4
Yeah, that looks like it could work. I could also use the auto_prepend_file directive to make it run on every page that gets loaded.

Since this will happen with every page load, I'll have to make sure this doesn't affect performance too much.


Top
 Profile  
 
PostPosted: Fri May 29, 2009 5:58 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
There's a dedicated extension for just what you need: http://pecl.php.net/package/inclued


Top
 Profile  
 
PostPosted: Mon Jun 08, 2009 5:44 pm 
Offline
DevNet Evangelist

Joined: Tue Dec 21, 2004 6:00 pm
Posts: 6267
Location: Winnipeg
Weirdan...dude your just on the ball today man...thats a pretty rockin extension :)

Ideally I am trying to figure out a way to determine every methods dependencies (in terms of functions, classes and/or includes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 10 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

Jump to:  
Powered by phpBB® Forum Software © phpBB Group