<?php

/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.X
 *	LICENSE: FL0M2SG681CQ - http://www.flynax.com/license-agreement.html
 *	PRODUCT: Pets Classifieds
 *	DOMAIN: pupsnshop.com
 *	FILE: CONTROL.INC.PHP
 *
 *	The software is a commercial product delivered under single, non-exclusive, 
 *	non-transferable license for one domain or IP address. Therefore distribution, 
 *	sale or transfer of the file in whole or in part without permission of Flynax 
 *	respective owners is considered to be illegal and breach of Flynax License End 
 *	User Agreement. 
 *
 *	You are not allowed to remove this information from the file without permission
 *	of Flynax respective owners.
 *
 *	Flynax Classifieds Software 2014 |  All copyrights reserved. 
 *
 *	http://www.flynax.com/
 *
 ******************************************************************************/

if ( function_exists('gzencode') && APP_USE_GZIP === true )
{
	header("Content-Type: application/x-gzip");
	header("Content-Encoding: gzip");
}
session_start();

// disable error reporting
error_reporting(0);
ini_set("display_errors", "0");

require_once(RL_CLASSES .'rlDb.class.php');
require_once(RL_CLASSES .'reefless.class.php');
require_once(RL_IPHONE_CLASSES .'iPhone.class.php');
require_once(RL_IPHONE_CLASSES .'PropertyList.class.php');

$rlDb = new rlDb();
$reefless = new reefless();
$iPhone = new iPhone();

// emulate smarty class
require_once(RL_IPHONE_CLASSES .'rlSmarty.class.php');
$GLOBALS['rlSmarty'] = new rlSmarty();

// load classes
$reefless -> connect(RL_DBHOST, RL_DBPORT, RL_DBUSER, RL_DBPASS, RL_DBNAME);
$reefless -> loadClass('Account');
$reefless -> loadClass('Config');
$reefless -> loadClass('Common');
$reefless -> loadClass('Cache');
$reefless -> loadClass('Valid');
$reefless -> loadClass('Lang');
$reefless -> loadClass('Hook');
$reefless -> loadClass('Debug');

// installed plugins list
$rlCommon -> getHooks();

// utf8 library functions
if ( function_exists('loadUTF8functions') === false ) {
	function loadUTF8functions() {
		$names = func_get_args();
		if ( empty($names) ) return false;

		foreach($names as $name) {
			if ( file_exists(RL_LIBS .'utf8'. RL_DS .'utils' .RL_DS . $name .'.php') ) {
				require_once(RL_LIBS .'utf8'. RL_DS .'utils'. RL_DS . $name .'.php');
			}
		}
	}
}