View file system/core.php

File size: 1.86Kb
<?php

$sys['mt'] = microtime(true);
$sys['t'] = time();

error_reporting(E_ALL);

ini_set('magic_quotes_gpc','off');

	function dump($var){echo '<pre><code>'.print_r($var,true).'</code></pre>';}
		function error($msg)
	{
	if(ob_get_level() > 0)ob_end_clean();
	header('Content-Type: text/html;charset=utf-8');
	echo '<html><head><title>Fatal Error</title></head><div style="font-weight:bold;font-size:18px;border: 1px solid #C0C0C0;"><center>Произошла системная ошибка</center>'.$msg.'<br /></div></html>';
	exit;
	}

		function show($add = null,$breakline = true)
	{
	if(!isset($GLOBALS['buffer']))$GLOBALS['buffer'] = null;
	if(empty($add))return ;
	$GLOBALS['buffer'] .= $add;
	if($breakline)$GLOBALS['buffer'] .= '<br />';
	}

$http['uri'] = htmlspecialchars($_SERVER['REQUEST_URI']);
$http['ua'] = htmlspecialchars(!empty($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : $_SERVER['HTTP_USER_AGENT']);
$http['ip'] = htmlspecialchars(!empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : (!empty($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : $_SERVER['REMOTE_ADDR']));
$http['host'] = strtolower($_SERVER['HTTP_HOST']);
$http['ae'] = !empty($_SERVER['HTTP_ACCEPT_ENCODING']) ? $u['ae'] = strtolower($_SERVER['HTTP_ACCEPT_ENCODING'])  : (!empty($_SERVER['HTTP_TE']) ?  $u['ae'] = strtolower($_SERVER['HTTP_TE']) : null);
$http['web'] = (stripos($http['ua'],'windows') !== false || stripos($http['ua'],'linux')!==false || stripos($http['ua'],'bsd') !== false || stripos($http['ua'],'x11') !== false || stripos($http['ua'],'unix') !== false || stripos($http['ua'],'macos') !== false || stripos($http['ua'],'macintosh') !== false) ? true : false;

// настройки
$config = parse_ini_file('system/config.ini',true);

define('SLSVER','1.1');
$rand = rand(1000,9999);

?>