[evolvis-commits] r14506: Prototype for centralised config

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Feb 28 04:19:31 CET 2011


Author: mirabilos
Date: 2011-02-28 04:19:31 +0100 (Mon, 28 Feb 2011)
New Revision: 14506

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

Added: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/config.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/config.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/config.php	2011-02-28 03:19:31 UTC (rev 14506)
@@ -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_base/evolvisforge-5.1/gforge/www/include/pre.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/pre.php	2011-02-28 03:19:28 UTC (rev 14505)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/pre.php	2011-02-28 03:19:31 UTC (rev 14506)
@@ -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 evolvis-commits mailing list