',$src,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'); $mem = (function_exists('memory_get_peak_usage')) ? memory_get_peak_usage() : memory_get_usage(); $msize = $mem - $mstart; $units = array('B', 'KB', 'MB'); $pos = 0; while ($msize >= 1024) { $msize /= 1024; $pos++; } $msize = round($msize, 2) . ' ' . $units[$pos]; list ($usec, $sec) = explode(' ', microtime()); $now = ((float) $usec + (float) $sec); $totalTime = ($now - $tstart); $totalTime = sprintf('%2.4f s', $totalTime); $r = array('[^q^]'=>'0','[^qt^]'=>'0s','[^p^]'=>$totalTime,'[^t^]'=>$totalTime,'[^s^]'=>'bypass_cache','[^m^]'=>$msize); $src = strtr($src,$r); if (is_file("{$base_path}autoload.php")) $loaded_autoload = include_once("{$base_path}autoload.php"); if ($src !== false) { echo $src; exit; } } } } if (!isset($loaded_autoload) && is_file("{$base_path}autoload.php")) include_once("{$base_path}autoload.php"); // harden it require_once("{$base_path}manager/includes/protect.inc.php"); require_once("{$base_path}manager/includes/initialize.inc.php"); // get the required includes if (!isset($database_type)) { $conf_path = "{$base_path}manager/includes/config.inc.php"; if (is_file($conf_path)) include_once($conf_path); // Be sure config.inc.php is there and that it contains some important values if ((!isset($lastInstallTime) || $lastInstallTime === NULL) && !isset($database_type)) { show_install(); exit; } } set_parser_mode(); startCMSSession(); // initiate a new document parser include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); $modx = new DocumentParser; $etomite = &$modx; // for backward compatibility $modx->tstart = $tstart; $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 (!MODX_API_MODE) { $result = $modx->executeParser(); echo $result; }