本文整理汇总了PHP中Errors::initHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP Errors::initHandler方法的具体用法?PHP Errors::initHandler怎么用?PHP Errors::initHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Errors
的用法示例。
在下文中一共展示了Errors::initHandler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setConfig
/**
* setConfig
*
* @param string $config
*/
public static function setConfig($config)
{
self::$_config = new Config_Ini($config);
Registry::set('top', '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"><head><title>%title% - Gmanager 0.8.1 beta</title><meta http-equiv="Content-Type" content="' . self::getContentType() . '; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="public/style.min.css"/><script type="text/javascript" src="public/script.min.js"></script></head><body>');
Registry::set('foot', '<div class="w">Powered by Gemorroj<br/><a href="http://wapinet.ru/gmanager/">wapinet.ru</a></div></body></html>');
Language::setLanguage(self::get('Gmanager', 'language'));
define('PCLZIP_TEMPORARY_DIR', self::getTemp() . '/');
define('GMANAGER_REQUEST_TIME', time());
mb_internal_encoding('UTF-8');
setlocale(LC_ALL, self::get('PHP', 'locale'));
date_default_timezone_set(self::get('PHP', 'timeZone'));
@set_time_limit(self::get('PHP', 'timeLimit'));
ini_set('max_execution_time', self::get('PHP', 'timeLimit'));
ini_set('memory_limit', self::get('PHP', 'memoryLimit'));
ini_set('error_log', Errors::getTraceFile());
ini_set('error_prepend_string', '<div class="red">');
ini_set('error_append_string', '</div><div class="rb"><br/></div>' . Registry::get('foot'));
Errors::initHandler();
if (self::get('Auth', 'enable')) {
Auth::main();
}
Gmanager::getInstance()->init();
}
示例2: showEval
/**
* showEval
*
* @param string $eval
* @return string
*/
public function showEval($eval = '')
{
$statEval = $eval . "\n" . 'return array(
"ram" => Helper_View::formatSize(memory_get_usage(false) - $gmanagerStatEvalInfo["ram"]),
"maxRam" => Helper_View::formatSize(memory_get_peak_usage(false) - $gmanagerStatEvalInfo["maxRam"]),
"time" => round(microtime(true) - $gmanagerStatEvalInfo["time"], 4)
);';
Errors::initHandlerEval();
$evalFunction = create_function('$gmanagerStatEvalInfo', $statEval);
if ($evalFunction !== false) {
$info = $evalFunction(array('time' => microtime(true), 'maxRam' => memory_get_peak_usage(false), 'ram' => memory_get_usage(false)));
} else {
$info = array('time' => '?', 'maxRam' => '?', 'ram' => '?');
}
$buf = Errors::getResultHandlerEval();
Errors::initHandler();
return '<div class="input">' . Language::get('result') . '<br/><textarea class="lines" cols="48" rows="' . Helper_View::getRows($buf) . '">' . htmlspecialchars($buf, ENT_NOQUOTES) . '</textarea><br/>' . str_replace('%time%', $info['time'], Language::get('microtime')) . '<br/>' . Language::get('memory_get_usage') . ' ' . $info['ram'] . '<br/>' . Language::get('memory_get_peak_usage') . ' ' . $info['maxRam'] . '<br/></div>';
}