1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-24 07:13:08 +02:00

Add profiler to TemplateFile and PageRender

This commit is contained in:
Ryan Cramer
2016-10-20 07:02:24 -04:00
parent 4060934bae
commit 5542b77440
2 changed files with 53 additions and 3 deletions

View File

@@ -500,7 +500,10 @@ class PageRender extends WireData implements Module, ConfigurableModule {
// own additional variables in it if they want to
$output->set('options', $options);
$profiler = $this->wire('profiler');
$profilerEvent = $profiler ? $profiler->start($page->path, $this, array('page' => $page)) : null;
$data = $output->render();
if($profilerEvent) $profiler->stop($profilerEvent);
}
if($data && $cacheAllowed && $cacheFile) $cacheFile->save($data);