-
-
Save Fi1osof/328469331b5258ff009a 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 | |
print '<pre>'; | |
ini_set('display_errors', 1); | |
$modx->switchContext('web'); | |
$modx->setLogLevel(3); | |
$modx->setLogTarget('HTML'); | |
$namespace = 'modxsite'; | |
if(!$response = $modx->runProcessor('web/getdata', | |
array( | |
), array( | |
'processors_path' => $modx->getObject('modNamespace', $namespace)->getCorePath().'processors/', | |
))){ | |
print "Не удалось выполнить процессор"; | |
return; | |
} | |
$memory = round(memory_get_usage(true)/1024/1024, 4).' Mb'; | |
print "<div>Memory: {$memory}</div>"; | |
$totalTime= (microtime(true) - $modx->startTime); | |
$queryTime= $modx->queryTime; | |
$queryTime= sprintf("%2.4f s", $queryTime); | |
$queries= isset ($modx->executedQueries) ? $modx->executedQueries : 0; | |
$totalTime= sprintf("%2.4f s", $totalTime); | |
$phpTime= $totalTime - $queryTime; | |
$phpTime= sprintf("%2.4f s", $phpTime); | |
print "<div>TotalTime: {$totalTime}</div>"; | |
// $objects = $response->getObject(); | |
// foreach($objects as $object){ | |
// } | |
print_r($response->getResponse()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment