<?
class conf
{
	////////////////////
	var $DEV_MODE	 = 0;
	var $DEV_CACHED = 0;
	////////////////////


	function conf() {
		$this->SYS_NAME					= 'perfectdent';
		$this->SYS_DOMAINS[]				= 'bielsko-dentysta.pl';
		$this->SYS_DOMAINS[]				= 'perfectdent.digihex.pl';
		$this->FORCE_DOMAIN_WWW			= true;
		$this->FORCE_DOMAIN_PRIMARY	= true;

		$this->SQL_DB_HOST				= 'localhost';
		$this->SQL_DB_USER				= 'bielskod_user';
		$this->SQL_DB_NAME				= 'bielskod_base';
		$this->SQL_DB_PASS				= '#S!Kt41lrXb0';


		$this->MAILER_FROM_NAME			= 'PerfectDent';
		$this->MAILER_FROM_EMAIL		= 'info@'.$this->SYS_DOMAINS[0];
		$this->MAILER_FOOT_TEXT			= 'Ta wiadomość została wysłana ze strony '.$this->SYS_DOMAINS[0];
		$this->MAILER_SMTP_ENABLED		= false;
		$this->MAILER_SMTP_PORT			= 587; //25 | 587
		$this->MAILER_SMTP_HOST			= '';
		$this->MAILER_SMTP_USER			= '';
		$this->MAILER_SMTP_PASS			= '';


		$this->SHOW_PGT					= 0;
		$this->SHOW_MEM					= 0;
		$this->SHOW_MEM_PGT_FRONT		= 0;
		$this->SHOW_DEV					= 1;
	}
}
$CONF=new conf();



if(!defined('ROOT')) define('ROOT', '.');
if(!defined('ROOT_PATH')) define('ROOT_PATH', realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', dirname(__FILE__))));
//////
define('LIBS', ROOT.'/libs');
define('LIBS_PATH', ROOT.'/libs');
define('LIBS_PATH_ADMIN', ROOT.'/admin/libs');
define('CACHE', ROOT.'/cache');
define('JS', ROOT.'/libs/js');
define('INC', ROOT.'/includes');
define('FORM_CONF', ROOT.'/includes/forms');
define('INC_PATH', ROOT.'/includes');
define('USR', ROOT.'/userfiles');
define('CLASSES', ROOT.'/classes');
define('IMG', ROOT.'/images');
//////
define('DATE', date('Y-m-d H:i:s'));
define('IP', $_SERVER['REMOTE_ADDR']);
if(empty($_SERVER['HTTP_HOST'])) $_SERVER['HTTP_HOST']=$CONF->SYS_DOMAINS[0];
define('DOMAIN', str_replace('www.', '', $_SERVER['HTTP_HOST']));
define('LOCALHOST', IP=='127.0.0.1' && DOMAIN=='localhost' ? 1:0);
define('URL', $_SERVER['REQUEST_URI']);
define('URI', $_SERVER['REQUEST_URI']);
define('PRE', 'font:11px Tahoma; color:#000;');
define('BASE', 'https://'.($CONF->FORCE_DOMAIN_WWW && !LOCALHOST ? 'www.':'').DOMAIN);
//////
define('USR_CK','_CMS_');







if(file_exists(CACHE.'/sysinfo.cache') && $CONF->DEV_CACHED==true) {
	$CONF->ENV=unserialize(file_get_contents(CACHE.'/sysinfo.cache'));
} else {
	$CONF->ENV['php_version']=substr(phpversion(), 0, (stristr(phpversion(),'-') ? strpos(phpversion(), '-') : 10));
	$CONF->ENV['mysql_version']=str_replace('mysqlnd ', '', mysql_get_client_info());
	if(stristr($CONF->ENV['mysql_version'],'-')) $CONF->ENV['mysql_version']=substr($CONF->ENV['mysql_version'], 0, strpos($CONF->ENV['mysql_version'],'-'));

	$INI=array(
		'',
		'post_max_size',
		'upload_max_filesize',
		'file_uploads',
		'magic_quotes_gpc',
		'',
		'max_execution_time',
		'max_input_time',
		'memory_limit',
		'session.gc_maxlifetime',
		'',
		'display_errors',
		'register_globals',
		'',
		'safe_mode',
		'allow_url_fopen',
		'eaccelerator.enable',
	);

	foreach($INI as $p) {
		if($p=='') {
			$CONF->ENV[]='';
		} else {
			$val=(int)ini_get($p);
			$CONF->ENV[$p]=$val;
		}
	}

	if(!is_dir(CACHE)) @mkdir(CACHE, 0755);
	file_put_contents(CACHE.'/.htaccess', 'Deny From All');
	file_put_contents(CACHE.'/sysinfo.cache', @serialize($CONF->ENV));
}


if(empty($_GET['lang']) && !empty($_SESSION['lang'])) $_GET['lang']=$_SESSION['lang'];
?>