All pastes #108632 Raw Edit

stef

public text v1 · immutable
#108632 ·published 2006-07-31 16:24 UTC
rendered paste body
<?
/**
*EzLang Main configs in here.
*
* This file sets up basic session parameters.
* @access 	public
* @author Stef Gosselin <stef@3wsimple.com>
* @copyright	swd 2005-04-13
* @version	V.002
* @since  	V.001
* @todo		{@link http://solutech.homelinux.org/ezlang/todo.txt TODO TEXT inline link}
* @package	 EzLang
* @subpackage	config
*/

/**
*=====================================================================
*  set base directories 
*
*  eg: http://127.0.0.1/ 
*  or http://www.domain.com
*/

DEFINE("WEB_ROOT", "http://".$_SERVER['SERVER_NAME']."/ezlang2/");
DEFINE("APP_ROOT", "/home/stef/dev/ezlang2/");

init(APP_ROOT);


/**
*  Yawp class include ...
*
* This file sets up language parameters.
* @access 	public
* @since  	V.001
*/
$YAWP_PATH = APP_ROOT."PEAR/Yawp-1.2.0/Yawp.php";
// echo $YAWPATH;
require_once($YAWP_PATH);


Yawp::start(APP_ROOT .'dev/ezlang.ini');
$EZLANG =& Yawp::singleton(); // new Yawp instance!


/*
* Include language configuration
*/
require_once(APP_ROOT ."/inc/lang_config.php");

// load the Savant class file
require_once 'Savant3.php';


// Instantiate a Savant3 object
$GLOBALS['Savant3'] =& new Savant3();
$GLOBALS['Savant3']->addPath(
    'template', Yawp::getConfElem('Savant3', 'template_path'));

$GLOBALS['Savant3']->addPath(
    'resource', Yawp::getConfElem('Savant3', 'resource_path'));

 // to dump an object 
//   Yawp::dump($object, 'the $object object');
//*************************************************************
/**
/**                    VARIOUS FUNCTIONS
/**       
/**************************************************************
  
* Sets the proper path delimeter for WIN/LINUX patform
*
*This functions sets the proper delimeters for the platform the 
*script is running on. 
*/

function set_delimeter(){

// Function that determines slashes to put 
// Determining platform

	if (PHP_OS == "WIN32" || PHP_OS == "WINNT") {
		
		$delim = ';';
		return $delim;
		
	}
	else if ((PHP_OS == "Linux") || (PHP_OS == "FreeBSD")){

		   $delim = ':';
		   return $delim;
	}
	else {
	 // echo PHP_OS;
	  // some other platform}
	  die("This script is not supported on this platform.");
	}
}

/**************************************************************
  
* Initialisation function 
*
*This function sts the path for libraries, sets error levels and basic session parameters.
*script is running on. 
*/

function  init($app_root){

$pear = $app_root . "PEAR/";

// For better performance, see notes below.

$delim = set_delimeter();

ini_set('include_path', "{$delim}$pear{$delim}".APP_ROOT."{$delim}include{$delim}{$delim}".APP_ROOT."PEAR{$delim}");


error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// set parameters for form output
ini_set('session.use_only_cookies',"0");
ini_set("arg_separator.output", "&amp;");
ini_set("session.use_trans_sid",1);

// We need this to have php play nice with the headers (xhtml compliant)
ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,fieldset=fakeentry");
//session_start();

//  echo $_SERVER['PATH'];

}
?>