3 * Sets the default required environnement for Gforge
5 * Some of the settings made here can be overwrite in the
6 * configuration file if needed.
10 # In case of errors, let output be clean.
11 $gfRequestTime = microtime( true );
13 @ini_set( 'memory_limit', '20M' );
14 @ini_set( "display_errors", true );
16 error_reporting( E_ALL );
18 # Attempt to set up the include path, to fix problems with relative includes
19 $IP = dirname(dirname( __FILE__ )) ;
20 $include_path = join(PATH_SEPARATOR,
21 array("/etc/gforge/custom", "/etc/gforge", "$IP/common", "$IP/www", "$IP/plugins", "$IP", "."));
23 // By default, the include_path is changed to include path needed by Gforge.
24 // If this does not work, then set defines to real path directly.
26 // In case of failure, the following defines are set:
27 // $gfconfig : Directory where are the configuration files (/etc/gforge).
28 // $gfcommon : Directory common of gforge (for common php classes).
29 // $gfwww : Directory www of gforge (publicly accessible files).
30 // $gfplugins: Directory for plugins.
33 // Easyforge config, allow several instances of gforge based on server name.
34 if (getenv('sys_localinc')) {
35 $gfcgfile = getenv('sys_localinc');
36 $gfconfig = dirname($gfcgfile).'/';
37 } elseif (isset($_SERVER['SERVER_NAME']) &&
38 file_exists($IP.'/config/'.$_SERVER['SERVER_NAME'].'/local.inc.php')) {
39 $gfcgfile = $IP.'/config/'.$_SERVER['SERVER_NAME'].'/local.inc.php';
40 $gfconfig = $IP.'/config/'.$_SERVER['SERVER_NAME'].'/';
41 } elseif (file_exists($IP.'/config/local.inc.php')) {
42 $gfcgfile = $IP.'/config/local.inc.php';
43 $gfconfig = $IP.'/config/';
45 $gfcgfile = 'local.inc';
49 if( !ini_set('include_path', $include_path ) && !set_include_path( $include_path )) {
50 $gfcommon = $IP.'/common/';
52 $gfplugins = $IP.'/plugins/';