Created
October 1, 2010 19:09
-
-
Save opengeek/606684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$output = ''; | |
$tElementClass = !empty($tElementClass) ? $tElementClass : 'modSnippet'; | |
$tStart = $modx->getMicroTime(); | |
if (!empty($tElement)) { | |
switch ($tElementClass) { | |
case 'modChunk': | |
$output = $modx->getChunk($tElement, $scriptProperties); | |
break; | |
case 'modSnippet': | |
$output = $modx->runSnippet($tElement, $scriptProperties); | |
break; | |
default: | |
$tElementObj = $modx->getObject($tElementClass, array('name' => $tElement)); | |
if ($tElementObj && $tElementObj instanceof modElement) { | |
$tElementObj->setCacheable(false); | |
$output = $tElementObj->process($scriptProperties); | |
} else { | |
$modx->log(modX::LOG_LEVEL_ERROR, "{$tElementClass}: {$tElement} is not a valid MODx Element"); | |
} | |
break; | |
} | |
} | |
$tEnd = $modx->getMicroTime(); | |
$modx->log(modX::LOG_LEVEL_ERROR, "{$tElementClass}: {$tElement} executed in " . sprintf("%2.4f s", $tEnd - $tStart)); | |
return $output; | |
?> |
You simply do:
[[!Executioner@inTheNews? &parents=[[*id]]
]]
You will have to attach the Executioner snippet to the Property Set though.
is this snippet still in development? If so, wouldn't be possible to add an option for automatically wrapping all snippets or chunks and displaying execution time for each element at the end of its code on the page?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jason, how can I use propertyset enabled call with executioner? eg. [[getResources@inTheNews? &parents=
[[*id]]
]]