<?php
/*------------------------------------------------------------------------
# Copyright (C) 2005-2012 WebxSolution Ltd. All Rights Reserved.
# @license - GPLv2.0
# Author: WebxSolution Ltd
# Websites:  http://www.webxsolution.com
# Terms of Use: An extension that is derived from the JoomlaCK editor will only be allowed under the following conditions: http://joomlackeditor.com/terms-of-use
# ------------------------------------------------------------------------*/ 

// defines database connection data
//Cause browser to reload page every time
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past


// set syatem constants
define( 'DS', DIRECTORY_SEPARATOR );

//get root folder
$rootFolder = explode(DS,dirname(__FILE__));
	
//current level in diretoty structure
$currentfolderlevel = 6;

array_splice($rootFolder,-$currentfolderlevel);

$base_folder = implode(DS,$rootFolder);

define( '_JEXEC', 1 );

if (file_exists($base_folder.DS.'defines.php')) {
	include_once $base_folder.DS.'defines.php';
}

if (!defined('_JDEFINES')) {
	define('JPATH_BASE',$base_folder);
	require_once (JPATH_BASE.DS.'includes'.DS.'defines.php');
}
	
/* Load in the configuation file */

//require_once( '../../../../../../../configuration.php' );
require_once( JPATH_CONFIGURATION	.DS.'configuration.php' );


define('JPATH_PLATFORM',JPATH_LIBRARIES);

/*load loader class */
require_once(JPATH_LIBRARIES .DS.'loader.php' );

define('_JREQUEST_NO_CLEAN',1);

if(file_exists(JPATH_LIBRARIES.'/import.php'))
	require_once JPATH_LIBRARIES.'/import.php';
elseif(file_exists(JPATH_LIBRARIES.'/joomla/import.php'))
	require_once JPATH_LIBRARIES.'/joomla/import.php';	

if(file_exists(JPATH_LIBRARIES.'/import.legacy.php'))
	require_once JPATH_LIBRARIES.'/import.legacy.php';	
	
	
// Botstrap the CMS libraries.
if(file_exists(JPATH_LIBRARIES.'/cms.php'))
	require_once JPATH_LIBRARIES.'/cms.php';

	
if (!class_exists('JVersion')) {
	if(file_exists(JPATH_ROOT.'/includes/version.php'))
		require JPATH_ROOT.'/includes/version.php';
}

/* Load Joomla's required classes */

jimport('joomla.filter.filterinput');
jimport('joomla.log.log');
jimport('joomla.database.database');
jimport('joomla.factory');
jimport('joomla.error.error');
jimport('joomla.environment.uri');

//get system parameters

$JConfig = new JConfig();

							
define('DB_DRIVER',$JConfig->dbtype);
define('DB_HOST', $JConfig->host);
define('DB_USER', $JConfig->user );
define('DB_PASSWORD',$JConfig->password);
define('DB_DATABASE', $JConfig->db ); 
define('DB_PREFIX', $JConfig->dbprefix); 
define('DB_OFFLINE', $JConfig->offline);

