예제 #1
0
파일: init.php 프로젝트: divyinfo/SuperNova
$sn_root_relative = str_replace('\\', '/', getcwd());
$sn_root_relative .= $sn_root_relative[strlen($sn_root_relative) - 1] == '/' ? '' : '/';
$sn_root_relative = str_replace(SN_ROOT_PHYSICAL, '', $sn_root_relative);
$sn_root_relative .= basename($_SERVER['SCRIPT_NAME']);
$sn_root_relative = str_replace($sn_root_relative, '', $_SERVER['SCRIPT_NAME']);
define('SN_ROOT_RELATIVE', $sn_root_relative);
define('SN_ROOT_VIRTUAL', 'http' . (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . SN_ROOT_RELATIVE);
define('SN_ROOT_VIRTUAL_PARENT', str_replace('//google.', '//', SN_ROOT_VIRTUAL));
$phpEx = strpos($phpEx = substr(strrchr(__FILE__, '.'), 1), '/') === false ? $phpEx : '';
define('PHP_EX', $phpEx);
// PHP extension on this server
define('DOT_PHP_EX', '.' . PHP_EX);
// PHP extension on this server
require_once 'constants.php';
require_once 'classes/supernova.php';
classSupernova::init_0_prepare();
//classSupernova::init_1_constants();
classSupernova::init_3_load_config_file();
header('Content-type: text/html; charset=utf-8');
ob_start();
ini_set('error_reporting', E_ALL ^ E_NOTICE);
// TODO - Разобраться с порядком подключени и зависимостями объектов
require_once 'classes/core_classes.php';
// required for db.php
// Initializing global 'debug' object
require_once SN_ROOT_PHYSICAL . "includes/debug.class" . DOT_PHP_EX;
global $debug;
$debug = new debug();
classSupernova::debug_set_handler($debug);
require_once SN_ROOT_PHYSICAL . "includes/db" . DOT_PHP_EX;
require_once 'classes/db_mysql_v4.php';