<?php

/*
  PHP version 5
  Copyright (c) 2002-2018 ECISP.CN、EarcLink.COM
  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖
  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030 / 13797552220
 */
error_reporting(0);
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('memory_limit', '640M');
ini_set('default_charset', 'utf-8');
define('ESPCMS_ADMIN_PATH', dirname(__FILE__) . '/');
define('ESPCMS_ADMIN_PATH_FILE', dirname(__FILE__));
define('ESPCMS_ADMIN_DIRNAME', 'espcms_admin');
define('ESPCMS_FILE_ROOT', str_replace(ESPCMS_ADMIN_DIRNAME, '', ESPCMS_ADMIN_PATH_FILE));
define('ESPCMS_ISADMIN', true);
if (file_exists(ESPCMS_FILE_ROOT . 'espcms_datacache/espcms_config.php')) {
	require_once( ESPCMS_FILE_ROOT . 'espcms_datacache/espcms_config.php' );
} else {
	exit('错误：数据库文件错误');
}
if (file_exists(ESPCMS_FILE_ROOT . 'espcms_includes/espcms_version.php')) {
	require_once(ESPCMS_FILE_ROOT . 'espcms_includes/espcms_version.php');
} else {
	exit('错误：版本配置文件不存在');
}
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_variable.php');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_constant.php');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_function.php');
espcms_bug_mode();
espcms_load_constant();
espcms_cache_constant();
$_SERVER = espcms_server_vars();
global $espcms_version, $espcms_db_version, $espcms_tinymce_version, $loading_php_version, $loading_mysql_version;
espcms_loadcheck_php_versions();
espcms_command();
$timeoffset = preg_match("/^[0-9.\-]+$/i", $espcms_command['BASIC_TIMEZONE']) ? $espcms_command['BASIC_TIMEZONE'] * -1 : 8 * -1;
date_default_timezone_set("Etc/GMT$timeoffset");
require_espcms_link_db();
espcms_loadcheck_mysql_versions();
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_tool.php');
espcms_magic_quotes();
define('ESPCMS_ADMIN_URL', espcms_host('AP'));
define('ESPCMS_URL', str_replace(ESPCMS_ADMIN_DIRNAME . '/', '', ESPCMS_ADMIN_URL));
define('ESPCMS_WWW_URL', espcms_host('WWW_RT'));
define('ESPCMS_URL_RT', str_replace(ESPCMS_ADMIN_DIRNAME . '/', '', espcms_host('RT')));
define('ESPCMS_ADMIN_THEMES_NAME', 'espcms_admin_templates');
define('ESPCMS_TEMPLATES_PATH', ESPCMS_ADMIN_URL . ESPCMS_ADMIN_THEMES_NAME . '/');
$act_name = espcms_get_act();
$action = $act_name ? $act_name : ESPCMS_ADMIN_RUN_MODULE;
require_once(ESPCMS_FILE_ROOT . ESPCMS_ADMIN_DIRNAME . '/espcms_admin_includes/espcms_run.php');
