3 * Sets the default required environement for FusionForge
5 * Some of the settings made here can be overwrite in the
6 * configuration file if needed.
10 // Attempt to set up the include path, to fix problems with relative includes
11 $fusionforge_basedir = dirname(dirname( __FILE__ )) ;
12 $include_path = join(PATH_SEPARATOR,
13 array("/etc/gforge/custom", "/etc/gforge", ".",
14 "$fusionforge_basedir/common", "$fusionforge_basedir/www",
15 "$fusionforge_basedir/plugins", "$fusionforge_basedir",
18 // By default, the include_path is changed to include path needed by Gforge.
19 // If this does not work, then set defines to real path directly.
21 // In case of failure, the following defines are set:
22 // $gfconfig : Directory where are the configuration files (/etc/gforge).
23 // $gfcommon : Directory common of gforge (for common php classes).
24 // $gfwww : Directory www of gforge (publicly accessible files).
25 // $gfplugins: Directory for plugins.
28 // Easyforge config, allow several instances of gforge based on server name.
29 if (getenv('sys_localinc')) {
30 $gfcgfile = getenv('sys_localinc');
31 $gfconfig = dirname($gfcgfile).'/';
32 } elseif (isset($_SERVER['SERVER_NAME']) &&
33 file_exists($fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/local.inc.php')) {
34 $gfcgfile = $fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/local.inc.php';
35 $gfconfig = $fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/';
36 } elseif (file_exists($fusionforge_basedir.'/config/local.inc.php')) {
37 $gfcgfile = $fusionforge_basedir.'/config/local.inc.php';
38 $gfconfig = $fusionforge_basedir.'/config/';
39 } elseif (file_exists('/etc/gforge/local.inc.php')) {
40 $gfcgfile = '/etc/gforge/local.inc.php';
41 $gfconfig = '/etc/gforge/';
42 } elseif (file_exists('/etc/gforge/local.inc')) {
43 $gfcgfile = '/etc/gforge/local.inc';
44 $gfconfig = '/etc/gforge/';
46 $gfcgfile = 'local.inc';
50 if( !ini_set('include_path', $include_path ) && !set_include_path( $include_path )) {
51 $gfcommon = $fusionforge_basedir.'/common/';
52 $gfwww = $fusionforge_basedir.'/www/';
53 $gfplugins = $fusionforge_basedir.'/plugins/';