[Fusionforge-commits] r14704 - trunk/src/common/include

Alain Peyrat aljeux at fusionforge.org
Tue Oct 25 09:45:19 CEST 2011


Author: aljeux
Date: 2011-10-25 09:45:18 +0200 (Tue, 25 Oct 2011)
New Revision: 14704

Modified:
   trunk/src/common/include/env.inc.php
Log:
Define include_path after $gfconfig

Modified: trunk/src/common/include/env.inc.php
===================================================================
--- trunk/src/common/include/env.inc.php	2011-10-24 14:58:20 UTC (rev 14703)
+++ trunk/src/common/include/env.inc.php	2011-10-25 07:45:18 UTC (rev 14704)
@@ -9,13 +9,6 @@
 
 // Attempt to set up the include path, to fix problems with relative includes
 $fusionforge_basedir = dirname(dirname(dirname( __FILE__ ))) ;
-$include_path = join(PATH_SEPARATOR,
-	array("/etc/gforge/custom", "/etc/gforge", ".",
-		"$fusionforge_basedir/common", "$fusionforge_basedir/www",
-		"$fusionforge_basedir/plugins", "$fusionforge_basedir",
-		"$fusionforge_basedir/www/include",
-		"$fusionforge_basedir/common/include",
-		"/usr/share/php","/usr/share/pear"));
 
 // By default, the include_path is changed to include path needed by Gforge.
 // If this does not work, then set defines to real path directly.
@@ -44,15 +37,33 @@
 } elseif (file_exists('/etc/gforge/local.inc')) {
 	$gfcgfile = '/etc/gforge/local.inc';
 	$gfconfig = '/etc/gforge/';
+} elseif (file_exists('/etc/gforge/config.ini')) {
+	$gfconfig = '/etc/gforge/';
 } else {
 	$gfcgfile = 'local.inc';
 	if (is_dir('/etc/gforge')){
-                $gfconfig = '/etc/gforge/';
-        } else {
+		$gfconfig = '/etc/gforge/';
+	} else {
 		$gfconfig = '';
 	}
 }
 
+$include_path = join(PATH_SEPARATOR,
+	array(
+		$gfconfig.'/custom',
+		$gfconfig,
+		$fusionforge_basedir.'/common',
+		$fusionforge_basedir.'/www',
+		$fusionforge_basedir.'/plugins',
+		$fusionforge_basedir,
+		$fusionforge_basedir.'/www/include',
+		$fusionforge_basedir.'/common/include',
+		'.',
+		'/usr/share/php',
+		'/usr/share/pear'
+	)
+);
+
 if( !ini_set('include_path', $include_path ) && !set_include_path( $include_path )) {
 	$gfcommon = $fusionforge_basedir.'/common/';
 	$gfwww = $fusionforge_basedir.'/www/';




More information about the Fusionforge-commits mailing list