[Fusionforge-commits] r13212 - branches/Branch_5_1/src/common/include

Alain Peyrat aljeux at fusionforge.org
Fri Apr 22 17:05:29 CEST 2011


Author: aljeux
Date: 2011-04-22 17:05:28 +0200 (Fri, 22 Apr 2011)
New Revision: 13212

Modified:
   branches/Branch_5_1/src/common/include/config.php
Log:
Add forge_reset_config_item() in config.php

Modified: branches/Branch_5_1/src/common/include/config.php
===================================================================
--- branches/Branch_5_1/src/common/include/config.php	2011-04-22 14:52:41 UTC (rev 13211)
+++ branches/Branch_5_1/src/common/include/config.php	2011-04-22 15:05:28 UTC (rev 13212)
@@ -85,6 +85,14 @@
 		}
 	}
 
+	public function reset_value ($section, $var, $value) {
+		if (!isset ($this->settings[$section])) {
+			$this->settings[$section] = array () ;
+		}
+
+		$this->settings[$section][$var] = $value ;
+	}
+
 	function read_config_file ($file) {
 		if (file_exists($file) && is_readable($file)) {
 			$sections = parse_ini_file ($file, true) ;
@@ -226,6 +234,12 @@
 	}
 }
 
+function forge_reset_config_item ($var, $section, $default) {
+	$c = FusionForgeConfig::get_instance () ;
+
+	return $c->reset_value ($section, $var, $default) ;
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"




More information about the Fusionforge-commits mailing list