21285 Posts in 5732 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 227 Views |
-
How to trace file access when a page is browsed

14 September 2012 at 7:59pm Last edited: 14 September 2012 8:20pm
Hi,
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?
Thanks.
-
Re: How to trace file access when a page is browsed

14 September 2012 at 10:23pm Last edited: 14 September 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'.
*/
Director::set_environment_type('dev'); -
Re: How to trace file access when a page is browsed

15 September 2012 at 1:46am Last edited: 15 September 2012 7:51am
Hi,
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)
or
SS_Backtrace::backtrace
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.
-
Re: How to trace file access when a page is browsed

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 (http://doc.silverstripe.org/framework/en/2.4/reference/urlvariabletools..
You can also use tools such as XHProf for generating callgraphs and execution maps.
-
Re: How to trace file access when a page is browsed

15 September 2012 at 6:26pm Last edited: 15 September 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
| 227 Views | ||
|
Page:
1
|
Go to Top |


