<?php
/*
fiemeCP - BETA.
Written by, and managed by xDario.

The script may be altered at wish, but redistributing any part of it, even with credets, is prohibited. Currently, only myself and my website (http://www.dario-ml.com/) along with kryptodev are aloud to host my script.

©2011 xDario (created for Ohai Online)

You must provide a thanks on the page from which this is called, unless you have donated. If I find my class used without copyright, or a mention of appreciation, I will pursude you. Fiesta servers aren't thousands, so you're not hard to spot out.

Page: init.php (FiemeCP CORE)
Last Change: 30 June 2011
*/

if (!defined('IN_FIEME'))
{
	die("canno't directly access this page");
}

//set script constants
define('FIEME_REV', "0.8.0.0"); //00.08.00.000
define('FIEME_REV_CODE', "000800000");

//Where are we?
if(!defined('FIEME_ROOT'))
{
	define('FIEME_ROOT', dirname(dirname(__FILE__))."\\");
}

//Are we installed yet?
(@include_once FIEME_ROOT . "includes\cfg.php" ) or die("Please install the programm before using it. <a href='install/index.php'>Click here to do so</a>");

//Set the server name
define('FIEME_SERVERNAME', $cfg['srv_name']);

//Fire up the settings!
require_once FIEME_ROOT . 'includes\class.settings.php';
$settings = new fieme_settings;
$settings->path = FIEME_ROOT . 'includes\settings\\';

//DEVELOPER MODE!!!
define('FIEME_DEV', $settings->dev_mode());
$dev_content="";

//launch up default settings -> REQUIRED FOR CORE FUNCTIONS!
$settings->load("global");

define('SKIN_NAME', "fiedef");
define('TEMPLATES_DIRECTORY', $settings->template_locations);

//where is php installed? Default: xampp installation. Otherwise, check cfg.
define('PHP_LOCATION', $settings->php_location);

require_once FIEME_ROOT . 'includes\class.core.php';
$core = new core;

require_once FIEME_ROOT . 'includes\class.fiemecp_functions.php';

require_once FIEME_ROOT . 'includes\class.cache_handler.php';
$cache = new cache_handler;

require_once FIEME_ROOT . 'includes\class.templates.php';
$template = new template;

require_once FIEME_ROOT . 'includes\class.languages.php';
$lang = new fieme_lang;
$lang->path = FIEME_ROOT . 'includes\lang\\';

//Let's define our fieme, since we're going to need it for the plugin system.
$fiemecp = new fiemecp_class();

require_once FIEME_ROOT . 'includes\class.plugins.php';
$plugin = new fieme_plugins;
$plugin->load();

//Low, low, low end hooks come here. Remember that these are run on EVERY PAGE LOAD, INCLUDING ADMIN so only use if it's a necessity to load everywhere.
//If you only need it for the user end fieme, hook it up in global_page_start
$plugin->run_hooks("core_init_start");

//launch up the maintainance functions. Backups (soon) and such.
$core->maintainance_functions();