Jump to content

Usage Details


redbullmarky

Recommended Posts

Hi all

This may not be much a design issue, but might be something more suitable for the local crowd to answer...

 

Recently, I've developed a nice framework, but as many of the functions/classes/methods are recycled from old stuff, alot of it is kinda rusty, deprecated, etc and I wish to get rid. Also, each time I package up the files of a new site (built on the framework) for a client, I don't need to include files that are completely unused - and don't necessarily wanna go through the whole thing picking out what I have/havent used, either

 

I currently have one main installation of my framework which happily drives about 4 sites (plus God knows how many development sites ontop of that, but that's a different story...)

 

What I wanna do is determine if there's a way (ideally without code, but open to suggestions) to:

a) determine what files PHP is including during a complete site run (obviously this will differ page to page, but if there's a report I can get, I can handle the rest)

b) determine ALL functions/methods that PHP is calling so I can easily trace and get rid of the old junk ones I don't use without breaking anything in other sites.

 

If PHP is able to tell me the answer to "a" above, then I could easily write something that would pull all the relevent framework files together when it comes to packaging it all up, so removing the need to include my entire framework.

 

I don't mind getting down and dirty with something lower level than PHP if it's the only way to go, but if there is anything I'm missing or any tools I could be using, please share ;D

 

Cheers

Mark

Link to comment
Share on other sites

In order to see which files are included you can use get_included_files()

 

For tracing you can see if debug_print_backtrace() works for your needs, this will also show included files.

 

 

get_included_files() definitely does the trick in one respect - odd i'd never come across that before, so thanks - thats great!

 

debug_backtrace / debug_print_backtrace seem to only show a couple or three "steps" - ideally i'm looking at something with the ability of tracking every function call through the whole start to finish, if indeed that's possible.

 

anyways - cheers for the help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.