',$output,2); if(strpos($head,'"text/html";')===false) { $type=unserialize($head); header('Content-Type:' . $type . '; charset=utf-8'); } else header('Content-Type:text/html; charset=utf-8'); $msize = memory_get_peak_usage() - $mstart; $units = array('B', 'KB', 'MB'); $pos = 0; while ($msize >= 1024) { $msize /= 1024; $pos++; } $msize = round($msize, 2) . ' ' . $units[$pos]; $totalTime = (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']); $totalTime = sprintf('%2.4f s', $totalTime); $incs = get_included_files(); $r = array('[^q^]'=>'0','[^qt^]'=>'0s','[^p^]'=>$totalTime,'[^t^]'=>$totalTime,'[^s^]'=>'bypass_cache','[^m^]'=>$msize,'[^f^]'=>count($incs)); $output = strtr($output,$r); if (is_file("{$base_path}autoload.php")) $loaded_autoload = include $base_path . 'autoload.php'; if ($output !== false) { echo $output; exit; } } } } if (!isset($loaded_autoload) && is_file("{$base_path}autoload.php")) include_once("{$base_path}autoload.php"); // initiate a new document parser include_once('manager/includes/document.parser.class.inc.php'); $modx = new DocumentParser; $modx->mstart = $mstart; $modx->cacheRefreshTime = $cacheRefreshTime; if(isset($error_reporting)) $modx->error_reporting = $error_reporting; // execute the parser if index.php was not included if (defined('IN_PARSER_MODE')&&IN_PARSER_MODE==='true') { $result = $modx->executeParser(); echo $result; }