<?php

/*
  PHP version 5.3
  Copyright (c) 2002-2018 ECISP.CN、EarcLink.COM
  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖
  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030
 */
error_reporting(0);
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('magic_quotes_gpc', 1);
ini_set('memory_limit', '640M');
ini_set('default_charset', 'utf-8');
define("ESPCMS_ADMIN_PATH", dirname(__FILE__) . '/');
define("ESPCMS_ADMIN_PATH_FILE", dirname(__FILE__));
$adminPathAll = str_replace('/', '\\', ESPCMS_ADMIN_PATH_FILE);
define("ESPCMS_ADMIN_DIRNAME", substr($adminPathAll, strrpos($adminPathAll, '\\') + 1, strlen($adminPathAll)));
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');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_tool.php');
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 . '/');
global $espcms_version, $espcms_db_version, $espcms_tinymce_version, $loading_php_version, $loading_mysql_version;
$php_current_version = espcms_loadcheck_php_versions();
espcms_load_constant();
espcms_bug_mode();
espcms_cache_constant();
$_SERVER = espcms_server_vars();
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();
espcms_magic_quotes();
$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');
