Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to trace file access when a page is browsed

Go to End

5 Posts   774 Views


Community Member, 77 Posts

14 September 2012 at 7:59pm

Edited: 14/09/2012 8:20pm


I would like to move some generic code into a module. In order to help me do this I would like some visibility of file access when a page is browsed.

What would be the easiest way of achieving this?

When I browse the home page of my site in my dev installation by adding debug tools into the URL in a fresh installation of 2.4.7, I see no extra information.

For example adding ?debug_request=1 to http://acer/kenton/candy/home, where http://acer/kenton/candy is the root, shows no debug information. In fact when I browse http://acer/kenton/candy/home?debug_request=1, the page just renders as normal.

I am using Version 2.4.7 (My client's host runs PHP 5.2) in a WAMP stack and have tried IE8, Chrome (latest version) and FF (latest version). Nothing works.

Has anyone any idea of what I may have overlooked and what I need to do differently?



Community Member, 77 Posts

14 September 2012 at 10:23pm

Edited: 14/09/2012 10:24pm

Ok, I appear to be a step closer to sussing out how to list what files are accessed when a page is requested.

In order for the debug tools to work when variables are added to the URL, I needed to add the following line to mysite/_config.php.

* Set environment: 'dev', 'test', or 'live'.


Community Member, 77 Posts

15 September 2012 at 1:46am

Edited: 15/09/2012 7:51am


It looks like it is currently not possible to get a complete list of files accessed in the order in which access occurs.

The best I could find was adding either

user_error("breakpoint", E_USER_ERROR)



into a class function depending on whether or not I want script execution to stop at the point of insertion.

Obviously this does not give a complete list from start to finish after a page is requested and rendering stops.


Forum Moderator, 5523 Posts

15 September 2012 at 5:14pm

According to the docs that should work. Do you get any output if you use ?show_templates=1 or any of the other URL variables (

You can also use tools such as XHProf for generating callgraphs and execution maps.


Community Member, 77 Posts

15 September 2012 at 6:26pm

Edited: 15/09/2012 7:10pm

Thanks Willr for the tips.

The other tools worked as expected but none of them went from start to finish where finish is the last file accessed before the last element in the requested page is rendered onto the screen.

PS. I tried to Google and enter "?show_templates=1" in the above search box which is placed just above Jump to:. Nothing was returned by Google (when I searched for ["silverstripe" "show_templates"] without the brackets) and when I entered "show_templates" into the above search box without the quotes, all I saw returned was this post. Did you mean ?showtemplate=1