本文整理匯總了PHP中sys::time_start方法的典型用法代碼示例。如果您正苦於以下問題:PHP sys::time_start方法的具體用法?PHP sys::time_start怎麽用?PHP sys::time_start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sys
的用法示例。
在下文中一共展示了sys::time_start方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
static function init()
{
self::$time_start = sys_get_microtime();
// clean request vars
if (ini_get("magic_quotes_gpc") !== false and get_magic_quotes_gpc()) {
modify::stripslashes($_REQUEST);
}
foreach ($_REQUEST as $key => $val) {
if (is_array($val) and count($val) > 0) {
$_REQUEST[$key] = array();
foreach ($val as $val2) {
if (!is_array($val2)) {
$_REQUEST[$key][$val2] = $val2;
}
}
}
}
// set up smarty
self::$smarty = new Smarty();
self::$smarty->register_prefilter(array("modify", "urladdon_quote"));
if (isset($_REQUEST["print"])) {
self::$smarty->register_outputfilter(array("modify", "striplinksforms"));
}
if (isset($_REQUEST["print"])) {
self::$smarty->assign("print", $_REQUEST["print"]);
}
self::$smarty->compile_dir = SIMPLE_CACHE . "/smarty";
self::$smarty->template_dir = "templates";
self::$smarty->config_dir = "templates/css";
self::$smarty->compile_check = false;
// refresh smarty cache
if (DEBUG) {
debug_check_tpl();
}
// set up database
if (!sql_connect(SETUP_DB_HOST, SETUP_DB_USER, sys_decrypt(SETUP_DB_PW, sha1(SETUP_ADMIN_USER)), SETUP_DB_NAME)) {
$err = sprintf("{t}Cannot connect to database %s on %s.{/t}\n", SETUP_DB_NAME, SETUP_DB_HOST) . sql_error();
trigger_error($err, E_USER_ERROR);
sys_die($err);
}
// verify credentials
login_handle_login();
}