Пример #1
0
$global_config['error_log_fileext'] = NV_LOGS_EXT;
//Ket noi voi class Error_handler
$ErrorHandler = new NukeViet\Core\Error($global_config);
set_error_handler(array(&$ErrorHandler, 'error_handler'));
//Ket noi voi cac file cau hinh, function va template
require NV_ROOTDIR . '/install/ini.php';
require NV_ROOTDIR . '/includes/utf8/' . $sys_info['string_handler'] . '_string_handler.php';
require NV_ROOTDIR . '/includes/utf8/utf8_functions.php';
require NV_ROOTDIR . '/includes/core/filesystem_functions.php';
require NV_ROOTDIR . '/includes/functions.php';
require NV_ROOTDIR . '/includes/core/theme_functions.php';
$global_config['allow_request_mods'] = NV_ALLOW_REQUEST_MODS != '' ? array_map('trim', explode(',', NV_ALLOW_REQUEST_MODS)) : "request";
$global_config['request_default_mode'] = NV_REQUEST_DEFAULT_MODE != '' ? trim(NV_REQUEST_DEFAULT_MODE) : 'request';
$language_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/langs.ini', true);
//Ket noi voi class xu ly request
$nv_Request = new NukeViet\Core\Request($global_config, NV_CLIENT_IP);
define('NV_SERVER_NAME', $nv_Request->server_name);
//vd: mydomain1.com
define('NV_SERVER_PROTOCOL', $nv_Request->server_protocol);
//vd: http
define('NV_SERVER_PORT', $nv_Request->server_port);
//vd: 80
define('NV_MY_DOMAIN', $nv_Request->my_current_domain);
//vd: http://mydomain1.com:80
define('NV_HEADERSTATUS', $nv_Request->headerstatus);
//vd: HTTP/1.0
define('NV_USER_AGENT', $nv_Request->user_agent);
//HTTP_USER_AGENT
define("NV_BASE_SITEURL", preg_replace("/\\/install\$/", "/", $nv_Request->base_siteurl));
//vd: /ten_thu_muc_chua_site/
define("NV_BASE_ADMINURL", $nv_Request->base_adminurl . '/');
Пример #2
0
// IP Ban
if (nv_is_banIp(NV_CLIENT_IP)) {
    trigger_error('Hi and Good-bye!!!', 256);
}
// Chan proxy
if ($global_config['proxy_blocker'] != 0) {
    $client_info['is_proxy'] = $ips->nv_check_proxy();
    if (nv_is_blocker_proxy($client_info['is_proxy'], $global_config['proxy_blocker'])) {
        trigger_error('ERROR: You are behind a proxy server. Please disconnect and come again!', 256);
    }
}
if (defined('NV_SYSTEM')) {
    require NV_ROOTDIR . '/includes/request_uri.php';
}
// Ket noi voi class xu ly request
$nv_Request = new NukeViet\Core\Request($global_config, NV_CLIENT_IP);
define('NV_SERVER_NAME', $nv_Request->server_name);
// vd: mydomain1.com
define('NV_SERVER_PROTOCOL', $nv_Request->server_protocol);
// vd: http
define('NV_SERVER_PORT', $nv_Request->server_port);
// vd: 80
define('NV_MY_DOMAIN', $nv_Request->my_current_domain);
// vd: http://mydomain1.com:80
define('NV_HEADERSTATUS', $nv_Request->headerstatus);
// vd: HTTP/1.0
define('NV_BASE_SITEURL', $nv_Request->base_siteurl . '/');
// vd: /ten_thu_muc_chua_site/
define('NV_BASE_ADMINURL', $nv_Request->base_adminurl . '/');
// vd: /ten_thu_muc_chua_site/admin/
define('NV_DOCUMENT_ROOT', $nv_Request->doc_root);