<?php
/*
  PHP version 5
  Copyright (c) 2002-2019ECISP.CN、EarcLink.COM
  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖
  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030 / 13797552220
*/
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_constant.php');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_function.php');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_variable.php');
require_once(ESPCMS_FILE_ROOT . 'espcms_includes/espcms_instal.php');
global $espcms_version, $espcms_db_version, $espcms_tinymce_version, $loading_php_version, $espcms_license;
$php_current_version = espcms_loadcheck_php_versions();
espcms_load_constant();
espcms_bug_mode();
espcms_cache_constant();
$_SERVER = espcms_server_vars();
espcms_loadcheck_php_curl();
date_default_timezone_set('PRC');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_tool.php');
espcms_magic_quotes();
spl_autoload_register('setup_autoload');
define('ESPCMS_URL', preg_replace('/' . str_replace('/', '\/', ESPCMS_INSTALL_DIRNAME) . '(.*)/i', '', espcms_host('AP')));
define('ESPCMS_WWW_URL', espcms_host('WWW_RT'));
define('ESPCMS_URL_RT', espcms_host('RT'));
$ac_name = espcms_get_ac() ? espcms_get_ac() : ESPCMS_SETUP_RUN_AC;
$at_name = espcms_get_at() ? espcms_get_at() : ESPCMS_SETUP_RUN_AT;
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_db.php');
require_once(ESPCMS_FILE_ROOT . 'espcms_public/espcms_dbsave.php');
$espcms_web_templates = espcms_setup_template();
$module_filename = ESPCMS_FILE_ROOT . 'espcms_web/' . $ac_name . '.php';
if (!is_file($module_filename)) {
    espcms_message_err('public_pack-espcms_module_file_err', array($ac_name));
}
include $module_filename;
$espcms_fun_name = ESPCMS_FUN_PREFIX . $at_name;
if (method_exists($ac_name, $espcms_fun_name)) {
    $control = new $ac_name;
    $control->$espcms_fun_name();
} else {
    espcms_message_err('public_pack-espcms_method_name_err', array($ac_name . '/' . $at_name));
}
