public static function header($code, $message = '') { switch ($code) { case 400: header('HTTP/1.1 400 Bad Request'); break; case 404: header('HTTP/1.1 404 Not Found'); break; case 503: default: header('HTTP/1.1 503 Service Unavailable'); break; } try { TPL::trash(); TPL::$dirpath = ESCMS_PATH_TPL . '.debug/'; TPL::add(array('EXCEPTION_MESSAGE' => $message)); if (!TPL::addTpl('header' . $code)) { switch ($code) { case 400: die('<h1>HTTP/1.1 400 Bad Request</h1><p>' . $message . '</p>'); break; case 404: die('<h1>HTTP/1.1 404 Not Found</h1>'); break; case 503: default: throw new Exception($message); } } else { TPL::pack(); die; } } catch (Exception $exc) { die('<h1>503 Service Unavailable</h1><p>' . $exc->getMessage() . '</p>'); } }
<?php define('IN_ACP', true); define('TEMPLATE_DIRPATH', './styles/.acp/'); require './config.php'; TPL::pack(); echo round(microtime(true) - $syslog->start, 3) * 1000 . ' ms'; //$syslog->log();