Location: PHPKode > projects > ZitPG (Zoom It! Photo Gallery) > zitpg_v0.04/configuration.php
<?php

	/*---------------------------------------------------------*\
	 | ZitPG v0.04                                             |
	 | http://zoomit.vertigoproject.net                        |
	 +---------------------------------------------------------+
	 | Copyright©2004|2005 Aldemar Bernal                      |
	 | hide@address.com                              |
	 +---------------------------------------------------------+
	 | License                                                 |
	 |                                                         |
	 | This program is an open source project and you can use  |
	 | or distribute it in your website but always keeping its |
	 | original copyright information and license.             |
	 |                                                         |
	 | If you want to know more about this license, please     |
	 | refer to the license.txt file or go to the official     |
	 | LGPL Website http://www.gnu.org/licenses/lgpl.txt       |
	 +---------------------------------------------------------+
	 | File: /configuration.php                                |
	 | Description: Site's Configuration.                      |
	\*---------------------------------------------------------*/


	include_once('classes/db_wrapper.php');


	//Please set up the follow configuration
	//The default configuration uses SQLite as DB
	//Don't forget to run the respective create_<dbserver>_db.php before index.php
	//Have fun!
	//Vertigo

	//USER CUSTOM CONFIGURATION
	//BEGINS HERE

		//MySQL Configuration
		$GLOBALS["mysql_server"] = "localhost";
		$GLOBALS["mysql_username"] = "root";
		$GLOBALS["mysql_password"] = NULL;
		$GLOBALS["mysql_database"] = "zoom_it";
		$GLOBALS["mysql_port"] = NULL;
		$GLOBALS["mysql_socket"] = NULL;
		
		//SQLite Configuration
		//I recommend you to set up this value using another name in other folder
		//e.g "../zitdb/zoom_it_database.sqlite"
		//Don't forget to assign the right permissions
		$GLOBALS["sqlite_database"] = "../zoom_it.sqlite";
	
		//PostgreSQL Configuration
		$GLOBALS["postgresql_server"] = "localhost";
		$GLOBALS["postgresql_username"] = "root";
		$GLOBALS["postgresql_password"] = NULL;
		$GLOBALS["postgresql_database"] = "zoom_it";
		$GLOBALS["postgresql_port"] = NULL;
	
		//Choose the database that Zoom It! is going to work with
		//Posible Values:
		//MySQL Server = db_mysql
		//PostgreSQL Server = db_postgresql
		//SQLite = db_sqlite
		$GLOBALS["database"] = db_sqlite;

	//USER CUSTOM CONFIGURATION
	//ENDS HERE

	$GLOBALS["db_server"] = NULL;
	$GLOBALS["db_username"] = NULL;
	$GLOBALS["db_password"] = NULL;
	$GLOBALS["db_database"] = NULL;
	$GLOBALS["db_port"] = NULL;
	$GLOBALS["db_socket"] = NULL;

	switch($GLOBALS["database"])
	{
		case db_mysql:
			$GLOBALS["db_server"] = $GLOBALS["mysql_server"];
			$GLOBALS["db_username"] = $GLOBALS["mysql_username"];
			$GLOBALS["db_password"] = $GLOBALS["mysql_password"];
			$GLOBALS["db_database"] = $GLOBALS["mysql_database"];
			$GLOBALS["db_port"] = $GLOBALS["mysql_port"];
			$GLOBALS["db_socket"] = $GLOBALS["mysql_socket"];
			break;
		case db_sqlite:
			$GLOBALS["db_database"] = $GLOBALS["sqlite_database"];
			break;
		case db_postgresql:
			$GLOBALS["db_server"] = $GLOBALS["postgresql_server"];
			$GLOBALS["db_username"] = $GLOBALS["postgresql_username"];
			$GLOBALS["db_password"] = $GLOBALS["postgresql_password"];
			$GLOBALS["db_database"] = $GLOBALS["postgresql_database"];
			$GLOBALS["db_port"] = $GLOBALS["postgresql_port"];
			break;
		default:
			echo "<strong>DB Error:</strong> Unknown database!";
			exit();
			break;
	}

	//Set Global Variables
	$GLOBALS["database_object"] = NULL;
	$GLOBALS["number_anonymous_users"] = 0;
	$GLOBALS["users_online"] = array();
	$GLOBALS["number_hits"] = 0;
	$GLOBALS["import_from_get"] = TRUE;
	$GLOBALS["page_filename"] = 'site/home.php';
	$GLOBALS["form_errors"] = "";


	//Load configuration using SimpleXML
	if(file_exists('configuration.xml'))
	{
		$configuration = simplexml_load_file('configuration.xml');

		if($configuration != FALSE)
		{
			foreach($configuration as $configurations_var)
				$GLOBALS[(string)$configurations_var['name']] = (string)$configurations_var['value'];
		}
		else
		{
			echo "<br /><strong>XML Error:</strong> The XML Configuration file is corrupted!";
			exit();
		}
	}
	else
	{
		echo "<br /><strong>XML Error:</strong> The XML Configuration file is missing!";
		exit();
	}

	session_start();
	if(!isset($_SESSION["username"]))
		$_SESSION["username"] = "";

?>
Return current item: ZitPG (Zoom It! Photo Gallery)