Файл: sys/inc/start.php
Строк: 114
<?
version_compare(PHP_VERSION, '5.2', '>=') or die('Требуется PHP >= 5.2');
define('TIME_START', microtime(true));
define('TIME', time());
define('TIME_TODAY',mktime(0, 0, 0));
define('DCMS_MOBILE', true);
define("H", $_SERVER["DOCUMENT_ROOT"].'/');
define('TEMP', R . '/sys/tmp');
define('TMP', R . '/sys/tmp');
define('IS_MAIN', $_SERVER['SCRIPT_NAME'] == '/index.php');
define('SESSION_LIFE_TIME', 600);
define('SESSION_NAME', 'DCMS_SESSION');
define('SESSION_ID_USER', 'DCMS_SESSION_ID_USER');
define('SESSION_PASSWORD_USER', 'DCMS_SESSION_PASSWORD_USER');
define('COOKIE_ID_USER', 'DCMS_COOKIE_ID_USER');
define('COOKIE_USER_PASSWORD', 'DCMS_COOKIE_USER_PASSWORD');
define('URL', urlencode($_SERVER ['REQUEST_URI']));
define('USE_MBSTRING', function_exists('mb_get_info'));
define('USE_ICONV', function_exists('iconv'));
define('SET_TIME_LIMIT', function_exists('set_time_limit'));
define('USE_GD', function_exists('gd_info'));
define('USE_MYSQL', function_exists('mysql_info'));
define('USE_FFMPEG', class_exists('ffmpeg_movie'));
define('USE_MCRYPT', function_exists('mcrypt_cbc'));
define('USE_ERROR_REPORTING', function_exists('error_reporting'));
define('CURL', function_exists('curl_init'));
define('CURL_MULTI', function_exists('curl_multi_init'));
if (!defined('IS_WINDOWS')) {
define('IS_WINDOWS', strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
}
if (function_exists('ini_set')){
ini_set('session.use_cookies', 1);
ini_set('session.use_trans_sid', 1);
ini_set('session.cache_expire', SESSION_LIFE_TIME);
ini_set('register_globals', 0);
ini_set('ignore_repeated_errors', true);
ini_set('error_reporting', E_ERROR);
ini_set('display_errors', true);
ini_set('date.timezone', 'Europe/Moscow');
ini_set('arg_separator.output', '&');
}
function dcmsAutoload($class_name) {
$path = H . '/sys/classes/' . strtolower($class_name) . '.class.php';
if (file_exists($path)) {
include_once ($path);
}
}
spl_autoload_register('dcmsAutoload');
if (ini_get('register_globals')) {
$allowed = array('_ENV' => 1, '_GET' => 1, '_POST' => 1, '_COOKIE' => 1, '_FILES' => 1, '_SERVER' => 1, '_REQUEST' => 1, 'GLOBALS' => 1);
foreach ($GLOBALS as $key => $value) {if (!isset($allowed[$key]))unset($GLOBALS[$key]);}
}
list($msec, $sec) = explode(chr(32), microtime());
$conf['headtime'] = $sec + $msec;
$time=TIME;
$phpvervion=explode('.', phpversion());
$conf['phpversion']=$phpvervion[0];
if (!USE_MYSQL) die('Расширение MySQL недоступно');
if (USE_ERROR_REPORTING)@error_reporting(0);
if (SET_TIME_LIMIT)@set_time_limit(60);
if (USE_MBSTRING)mb_internal_encoding('UTF-8');
if (USE_ICONV)iconv_set_encoding('internal_encoding', 'UTF-8');
session_name(SESSION_NAME) or die('Невозможно инициализировать сессии');
@session_start() or die('Невозможно инициализировать сессии');
define('SESS', preg_replace('#[^a-z0-9]#i', '', session_id()));
define('L', '<div id="comments" class="panel_text">
<div class="panel_text_set"><a href="/other/smiles.php">Смайлы</a></div>
<div class="panel_text_set"><a href="/other/bb.php">Теги</a></div></div>');
$sess=SESS;
$upload_max_filesize=ini_get('upload_max_filesize');
if (preg_match('#([0-9]*)([a-z]*)#i',$upload_max_filesize,$varrs))
{
if ($varrs[2]=='M')$upload_max_filesize=$varrs[1]*1048576;
elseif ($varrs[2]=='K')$upload_max_filesize=$varrs[1]*1024;
elseif ($varrs[2]=='G')$upload_max_filesize=$varrs[1]*1024*1048576;
}
include_once 'css.php';
?>