Location: PHPKode > projects > PHP SiteBuilder > include_all.php
<?php
/**
 * Collection of all the to include in the PHP SiteBuilder application
 *
 *	@file	include_all.php
 *	@author	Tobias H. Michaelsen <hide@address.com>
 *	@date	2000-11-03
 *
 *	$Id: include_all.php,v 1.35 2001/10/18 08:51:38 zaiborg Exp $
 */


//
// +----------------------------------------------------+
// |	Definitions and site specific initializations	|
// +----------------------------------------------------+
//

// We define that we are inside PHP Sitebuilder...
// check for this when we use 'others' code (eg. phpHoo)
define('__PHPSITEBUILDER', 1);

if (ini_get('register_globals') == false) {
	foreach ($HTTP_GET_VARS as $key => $val) $GLOBALS[$key] = $val;
	foreach ($HTTP_POST_VARS as $key => $val) $GLOBALS[$key] = $val;
	foreach ($HTTP_SERVER_VARS as $key => $val) $GLOBALS[$key] = $val;
}

// Set debug variables
if (isset($HTTP_GET_VARS['debug']) and $HTTP_GET_VARS['debug'] != 'false') {
	define('DEBUG', $HTTP_GET_VARS['debug']);
} elseif (isset($HTTP_GET_VARS['cfg']['debug']) and $HTTP_GET_VARS['cfg']['debug'] != 'false') {
	define('DEBUG', $HTTP_GET_VARS['cfg']['debug']);
} else {
	define('DEBUG', false);
}

// NOTE: This following lines may not work with CGI versions of PHP!!!
if (isset($HTTP_SERVER_VARS['PHP_SELF'])) 
	$this_href = $HTTP_SERVER_VARS['PHP_SELF'];
elseif (isset($HTTP_SERVER_VARS['PATH_INFO'])) 
	$this_href = $HTTP_SERVER_VARS['PATH_INFO'];

// Set the document root for our application
$site['docroot'] = dirname(str_replace("\\", "/", __FILE__)).'/';
$site['basehref'] = "http://".$HTTP_SERVER_VARS['HTTP_HOST'];
if(isset($this_href))
	$site['basehref'] .=	ereg_replace("/[^/]+$", "/", $this_href); // Remove everything after the last '/'

// set $sep = path separator
if (substr(PHP_OS,0,3) == "WIN") {
	// We are running under windows
	$sep = ';';
	define('SITE_OS', 'WIN');
} else {
	// linux/unix/bsd
	$sep = ':';
	define('SITE_OS', 'UNIX'); 
}

// Setup include_path to include our local include directory (2001-06-10)
ini_set('include_path', '.'.$sep.$site['docroot'].$sep.
	$site['docroot'].'include/pear'.$sep.ini_get('include_path'));

// When a function with the @-operator, errors are stored in $php_errormsg
// the last error message will always be present in the global variable $php_errormsg
if (!ini_get('track_errors')) {
	ini_set('track_errors', true);
}



//
// +------------------------------------------------------------+
// |	Include files											|
// |	- These only contain function and class declarations.	|
// |	- Maybe constants, but no variable definitions.			|
// +------------------------------------------------------------+
//
if (defined('COMPRESS_OUTPUT') and COMPRESS_OUTPUT == true) {
	include_once 'include/gzdoc.php';
}

// PEAR Classes
require_once 'PEAR.php';
require_once 'DB.php';
#require_once 'HTML/Form.php';

// Classes
require_once 'include/class.form.php';
//require_once 'include/class.helpers.php';
require_once 'include/class.mysql.php';
require_once 'include/class.timer.php';
require_once 'include/class.XML_Menu.php';
require_once 'include/class.XML_NewsBox.php';

// Functions
require_once 'include/function.array_columnsort.php';
require_once 'include/dynamisk.php';
require_once 'include/strings.inc.php';
require_once 'include/menu.php';
require_once 'include/global.php';

if (extension_loaded('zlib') and !function_exists('gzencode')) {
	// This is an emulation of the gzencode function, included in
	// PHP4 version >= 4.0.4, using gzcompress.
	include_once 'include/function.gzencode.php';
}


//
// +------------------------------------------------+
// |	Configuration								|
// |	- initialization of variables start here.	|
// +------------------------------------------------+
//
require_once 'config/config.site.php';
require_once 'config/config.php';
require_once 'config/config.text.php';


// {{{ this block between include config.php and include $langFile
	if (isset($HTTP_GET_VARS['lang'])) {
		$cfg['lang'] = $HTTP_GET_VARS['lang'];
	}
	
	$langFile = $site['docroot'].'config/lang.'.$cfg['lang'].'.php';
	if (!file_exists($langFile)) {
		$langFile = $site['docroot'].'config/lang.en.php';
		if (DEBUG) echo "DEFAULT Lang-file selected \n<br />";
	}
// }}} end block


require_once $langFile;
$txt = array_merge($txt, $langTxt);


/****** Date and time *******/
setlocale(LC_ALL, $txt['locale']);
$cfg['dateString'] = getDateTime($txt['longdate']);


/* vim: set tabstop=4: */
?>
Return current item: PHP SiteBuilder