<?php
	
	//Security
	if( ! defined( 'IS_SELF' ) )
	{
		die( 'Unauthorized Access' );
	}

	//Security
	define( 'IS_INIT' , true);
	
	//Include configuration file
	include_once( 'configuration.php' );
	
	//Include classes
	include_once( LIB_PATH . 'Handler.inc.php' );
	include_once( LIB_PATH . 'theme.inc.php' );
	include_once( LIB_PATH . 'database.inc.php' );
	include_once( LIB_PATH . 'session.inc.php' );
	include_once( LIB_PATH . 'user.inc.php' );
	include_once( LIB_PATH . 'functions.inc.php' );
	include_once( LIB_PATH . 'characters.inc.php' );
	include_once( LIB_PATH . 'ajax.inc.php' );
	
	//Set a global variable for the handler
	global $Handler;
	
	//Initialize Handler
	$Handler = new Handler();
	
	//Initialize Classes
	$Handler->NewHandle( 'theme' , new Theme() );
	$Handler->NewHandle( 'database' , new database() );
	$Handler->NewHandle( 'session' , new session() );
	$Handler->NewHandle( 'user' , new User() );
	$Handler->NewHandle( 'fn' , new Functions() );
	
	//Connect to database
	$Handler->database->Connect( SQL_HOST , SQL_USER , SQL_PASS );	
	?>