Location: PHPKode > projects > GroundOS > groundos/settings.php
<?php
/**
 * /settings.php
 *
 * Defines the basic settings that allow the core to run.    
 * 
 * @package AgaresCore4
 * @author Agares Media <hide@address.com>
 * @copyright Copyright (c) 2007, 2008, 2009 Agares Media.  All rights reserved.
 */

// Let's define these variables as global.  
global $defaultapp, $defaultloc, $homedir, $localpath, $domain, $globalsalt, $debug, $windowmanager, $userid, $wallpaper, $ftpserver, $defaultst, $installed;

/**
 * Database details 
 */
// Default database details for the AgaresCore installation.  Also includes the FTP address of the server
require('settings_db.php');

/**
 * Path and Domain Settings
 * 
 * The following global variables below are different paths to your script, including the local path that the server 
 * uses, as well as the URI to access the script.
 * 
 * For the best possible performance, it is recommended that you fill out settings_path.php properly, that way
 * the realpath(), str_replace(), and the substr() functions do not need to be called on every page load.
 */
require('settings_path.php');
if($usepathfile==false) {
	$installedonposix = false; // Set this to true if on Linux, BSD, Apple, etc.  Set to false if on Windows.  You will need to comment out the next line if you wish your setting here to stay, since the next line auto detects the OS.
	if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {$installedonposix = false;} else {	$installedonposix = true;}
	$installedonlinux = $installedonposix; // Kept here for legacy compatibility with AC 4.0.2 and below.
	if($installedonposix==false) { // Here you can set the value of the backslash used by your operating system.  This is for calling files locally from the server
		$pathbackslash = '\\'; 
	} else {
		$pathbackslash = '/';
	}
	$_p = $pathbackslash; // Shortcut for $pathbackslash

	if (isset($_SERVER['HTTPS'])) { $httpProtocal = 'https';} else {$httpProtocal = 'http';} // Used so that we automatically support SSL secured URLs 
	$basepath = realpath($_SERVER['DOCUMENT_ROOT']); // The web root
	$pathtoself = realpath($_SERVER['SCRIPT_FILENAME']); // The path to the index file of AC4
	$subdirectory = str_replace('\\', '/', str_replace("\index.php", '',str_replace($basepath, '', str_replace("/index.php", '', $pathtoself)))); // The directory under which AC4 is installed
	$localpath = realpath($basepath . $subdirectory); // The local path to the root of your AgaresCore 4 installation.
	$domain = $_SERVER['SERVER_NAME']; // The domain name 
	$homedir = $httpProtocal.'://'.$domain.$subdirectory; //  The web URI to your installation.
}

/**
 * Frontend Settings
 */
$defaultapp = 'default'; // This is the application you want the frontend to use by default
$defaultloc = 'index'; // This is the location within the app.  If you want the default, put 'index' here.
$defaultst = 'envbrand'; // The default Smarty template to use for AC4
$defaultpage = 'index.tpl'; // The default Smarty template file to use, within the template folder.
$defaultloginpage = $homedir . '/login/';

if ($installed == false) {
	$defaultapp = 'install';
	$defaultloc = 'index';	
}

/**
 * GroundOS Settings 
 */
$windowmanager = 'windowsjs'; // The default window manager is windowsjs.
$windowdecoration = 'agarescore4'; // The default window decoration.  Admins can override this individually by specify their own window decor within GroundOS.
$wallpaper = $homedir.'/data/wallpaper/wallpaper1.jpg'; // The full URI to the default wallpaper.
$groundos = false; // By default, we set $groundos to false.  This means that the current page is not within the GroundOS environment. 
$savegroundoswindows = false; // Set to true, this will save the opened windows, along with their properties, to the windows table in the database

$debug = true; // Set to true, debug messages are enabled.
$designermode = true; // Recommended false.  When this flag is set to true, any page created with the SiteDesigner application will be editable by every admin at all times.  When it's set to false, admin's must manually enter "Site Design" mode.

$globalsalt = '78dtysghhHGHsbZdg'; // $globalsalt is used in conjunction with user > user_key to create the authentication hash


$agarescoreversion = '4.0.3.0022'; // The current AgaresCore version and build number 
$groundosversion = 0.525; // The current GroundOS version number.

$widget=true; // Setting this to true enables the widgets located in the /widgets/ folder.  Setting this to false disables that.  Note that this is a voluntary flag, and if a widget isn't programmed to check for this variable, then it still will be enabled even if this is set to false.

// Misc Settings
set_time_limit(300);
if (ini_set("session.gc_maxlifetime","720000")) {;}
if (ini_set("session.gc_divisor","1000")) {;}
if (ini_set("session.cookie_lifetime","0")) {;}   

// Time zone:
date_default_timezone_set('America/Los_Angeles');

/*
 * Error handling
 */
if($debug==true) {
	if(ini_set("display_errors", 1)) {
		/* Attempt to use ini_set() */
	} else {
		error_reporting(E_ALL^E_STRICT); // Let's manually set the PHP error reporting level 
	}
	if (!function_exists('getUncaughtEx')) {
		function getUncaughtEx() {
		    // if error has been supressed with an @
		    if (error_reporting() == 0) {
		        return;
		    }
			$arr = get_defined_vars();
			echo '<div style="padding:25px 25px 25px 25px;border:1px solid #999999;font-family:Courier New,Terminal,Fixedsys,Courier">';
			echo '<h1>AgaresCore 4 Error Report</h1>';
			echo '<br />' . $additionalMessage. ' <br /><br />';
			echo '<b>ERROR MESSAGE:</b> ' . $e->getMessage() . '<br /><br />';
			echo '<b>CODE:</b> ' . $e->getCode() . '<br /><br />';
			echo '<b>FILENAME:</b> ' . $e->getFile() . '<br /><br />';
			echo '<b>ON LINE #</b>' . $e->getLine() . '<br /><br />';
			echo '<b>BACKTRACE:</b> <pre>'; print_r($e->getTrace()); echo '</pre><br /><br />';
			echo '<b>BACKTRACE: </b>'. $e->getTraceAsString(). '<br /><br />';
			echo '<b>VARIABLES:</b> <pre>';print_r(array_keys(get_defined_vars())); echo '</pre><br /><br />';
			echo '<b>VARIABLE VALUES:</b> <pre>';print_r($arr); echo '</pre><br /><br />';		
			echo '</div>';
			die('FATAL ERROR: UNCAUGHT EXCEPTION!');
		}
		set_exception_handler('getUncaughtEx');
	}
	
	
	
	if (!function_exists('myErrorHandler')) {
		function myErrorHandler($errno, $errstr, $errfile, $errline) {
			try {
				
				loadclass('rootclass');
				$rootclass = new rootclass();			
				
			    // if error has been supressed with an @
			    if (error_reporting() == 0) {
			        return;
			    }
				
			    switch ($errno) {
			    case E_USER_ERROR:
			        throw new Exception("<b>ERROR</b> [$errno] $errstr<br />\n  Fatal error on line $errline in file $errfile , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n Aborting...<br />\n");
			        break;
		
			    case E_USER_WARNING:
			    	throw new Exception("<b>WARNING</b> [$errno] $errstr<br />\n  Warning on line $errline in file $errfile , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n Aborting...<br />\n");
			        break;
		
			    case E_USER_NOTICE:
			    	throw new Exception("<b>NOTICE</b> [$errno] $errstr<br />\n  Notice on line $errline in file $errfile , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n Aborting...<br />\n");		    	
			        break;
		
			    default:
			    	throw new Exception("<b>ERROR</b> [$errno] $errstr<br />\n  Error on line $errline in file $errfile , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n Aborting...<br />\n");		    	
			        break;
			    }
			    return true;
			} catch(Exception $e) {
				$rootclass->errorReport($e, 'EXCEPTION.');
				die;
			}
		}
		set_error_handler('myErrorHandler'); // Uncomment this to disable the built in PHP error handler
	}
} else {
	error_reporting(0); // Turns error reporting off
	restore_exception_handler(); // Restore regular exception handler
	restore_error_handler(); // Restore error handler
}
	
/*
 * Sessions 
 */
if(!isset($_SESSION)) { // We only want to start the session once.
	session_start();
}


// Disables magic quotes if it is turned on.
if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value)
    {
        $value = is_array($value) ?
                    array_map('stripslashes_deep', $value) :
                    stripslashes($value);

        return $value;
    }

    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
    $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}

if (version_compare(phpversion(), '5.1.0', '<') == true){
	die ('AgaresCore 4.0+ requires PHP 5.1.0 and above only.');
}

?>
Return current item: GroundOS