Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions content/content.profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(){
}
}

public function build() {
public function build(array $context = []) {
$this->_view = (strlen(trim($_GET['profile'])) == 0 ? 'general' : $_GET['profile']);

// Build statistics
Expand All @@ -37,7 +37,7 @@ public function build() {
}
}

return parent::build();
return parent::build($context);
}

protected function buildJump(XMLElement $wrapper) {
Expand Down Expand Up @@ -87,6 +87,12 @@ protected function buildJump(XMLElement $wrapper) {
($this->_view == 'memory-usage')
));

$list->appendChild($this->buildJumpItem(
__('XSLT Execution'),
'?profile=xslt' . $this->_query_string,
($this->_view == 'xslt')
));

if(is_object(Symphony::Database())){
$list->appendChild($this->buildJumpItem(
__('Database Queries'),
Expand Down Expand Up @@ -228,6 +234,20 @@ public function buildContent(XMLElement $wrapper) {
}
}

else if ($this->_view == 'xslt') {
$file = Frontend::Page()->Proc->getProfiling();
$content = ($file && General::checkFileReadable($file)) ? file_get_contents($file) : null;
if (!$content) {
$content = __('Error');
} else {
General::deleteFile($file);
}
$row = new XMLElement('tr');
$row->appendChild(new XMLElement('th', __('Results')));
$row->appendChild((new XMLElement('td'))->appendChild(new XMLElement('pre', $content)));
$table->appendChild($row);
}

else if ($this->_records = $this->_records[$this->_view]) {
$ds_total = 0;

Expand Down
6 changes: 5 additions & 1 deletion extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ public function getSubscribedDelegates() {
public function frontendDevKitResolve($context) {
if (isset($_GET['profile'])) {
require_once(EXTENSIONS . '/profiledevkit/content/content.profile.php');


if ($_GET['profile'] === 'xslt') {
Frontend::Page()->Proc->setProfiling(TMP . '/xslt.profile');
}

$context['devkit'] = new Content_ProfileDevkit();
self::$active = true;
}
Expand Down