[Fusionforge-commits] r9053 - in trunk/gforge: common/include www/include

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Mar 15 14:01:26 CET 2010


Author: lolando
Date: 2010-03-15 14:01:25 +0100 (Mon, 15 Mar 2010)
New Revision: 9053

Added:
   trunk/gforge/common/include/config.php
Modified:
   trunk/gforge/www/include/pre.php
Log:
Prototype for centralised config

Added: trunk/gforge/common/include/config.php
===================================================================
--- trunk/gforge/common/include/config.php	                        (rev 0)
+++ trunk/gforge/common/include/config.php	2010-03-15 13:01:25 UTC (rev 9053)
@@ -0,0 +1,50 @@
+<?php
+/**
+ * FusionForge configuration functions
+ *
+ * Copyright 2009, Roland Mas
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+if (!isset ($fusionforge_config)) {
+	$fusionforge_config = array () ;
+}
+
+function get_config ($section, $var) {
+	if (!isset ($fusionforge_config[$section])) {
+		return false ;
+	}
+
+	if (!isset ($fusionforge_config[$section][$var])) {
+		return false ;
+	}
+
+	return $fusionforge_config[$section][$var] ;
+}
+
+function read_config () {
+	$fusionforge_config['core']['forge_name'] = $GLOBALS['sys_name'] ;
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Modified: trunk/gforge/www/include/pre.php
===================================================================
--- trunk/gforge/www/include/pre.php	2010-03-12 17:14:23 UTC (rev 9052)
+++ trunk/gforge/www/include/pre.php	2010-03-15 13:01:25 UTC (rev 9053)
@@ -32,6 +32,7 @@
 }
 
 require $gfcgfile;
+require $gfcommon.'include/config.php';
 
 // get constants used for flags or status
 require $gfcommon.'include/constants.php';




More information about the Fusionforge-commits mailing list