[Fusionforge-commits] r9991 - in trunk/gforge: common/include debian/patches plugins/scmsvn/etc

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Jun 3 17:02:33 CEST 2010


Author: lolando
Date: 2010-06-03 17:02:33 +0200 (Thu, 03 Jun 2010)
New Revision: 9991

Modified:
   trunk/gforge/common/include/config.php
   trunk/gforge/debian/patches/disable-dav.dpatch
   trunk/gforge/plugins/scmsvn/etc/scmsvn.ini
Log:
Variable interpolation needs to be delayed, so as to allow booleans to refer to one another, such as defining scmsvn/use_ssl=$core/use_ssl

Modified: trunk/gforge/common/include/config.php
===================================================================
--- trunk/gforge/common/include/config.php	2010-06-03 13:59:01 UTC (rev 9990)
+++ trunk/gforge/common/include/config.php	2010-06-03 15:02:33 UTC (rev 9991)
@@ -34,6 +34,17 @@
 		return self::$instance ;
 	}
   
+	public function get_sections () {
+		return array_keys ($this->settings) ;
+	}
+
+	public function get_variables ($section='core') {
+		if (isset ($this->settings[$section])) {
+			return array_keys ($this->settings[$section]) ;
+		}
+		return array () ;
+	}
+
 	public function get_value ($section, $var) {
 		if (!isset ($this->settings[$section])
 		    || !isset ($this->settings[$section][$var])) {
@@ -50,9 +61,20 @@
 				$tmp = str_replace ($m, $this->get_value($c[0],$c[1]), $tmp) ;
 			}
 		}
+		if ($this->is_bool ($section, $var)) {
+			$tmp = $this->_interpret_as_bool ($tmp) ;
+		}
 		return $tmp ;
 	}
 
+	public function get_raw_value ($section, $var) {
+		if (!isset ($this->settings[$section])
+		    || !isset ($this->settings[$section][$var])) {
+			return NULL ;
+		}
+		return $this->settings[$section][$var] ;
+	}
+
 	public function set_value ($section, $var, $value) {
 		if (!isset ($this->settings[$section])) {
 			$this->settings[$section] = array () ;
@@ -69,11 +91,7 @@
 			if (is_array($sections)) {
 				foreach ($sections as $section => $options) {
 					foreach ($options as $var => $value) {
-						if (isset ($this->bools[$section][$var])) {
-							$this->settings[$section][$var] = $this->_interpret_as_bool ($value) ;
-						} else {
-							$this->settings[$section][$var] = $value ;
-						}
+						$this->settings[$section][$var] = $value ;
 					}
 				}
 			}
@@ -86,10 +104,14 @@
 			$this->bools[$section] = array () ;
 		}
 		$this->bools[$section][$var] = true ;
+	}
 
-		if (isset ($this->settings[$section][$var])) {
-			$this->settings[$section][$var] = $this->_interpret_as_bool ($this->settings[$section][$var]) ;
+	function is_bool ($section, $var) {
+		if (isset ($this->bools[$section])
+		    && isset ($this->bools[$section][$var])) {
+			return $this->bools[$section][$var] ;
 		}
+		return false ;
 	}
 
 	private function _interpret_as_bool ($val) {

Modified: trunk/gforge/debian/patches/disable-dav.dpatch
===================================================================
--- trunk/gforge/debian/patches/disable-dav.dpatch	2010-06-03 13:59:01 UTC (rev 9990)
+++ trunk/gforge/debian/patches/disable-dav.dpatch	2010-06-03 15:02:33 UTC (rev 9991)
@@ -5,9 +5,9 @@
 ## DP: Disable SVN-over-WebDAV
 
 @DPATCH@
-diff -urNad gforge~/plugins/scmsvn/etc/plugins/scmsvn/config.php gforge/plugins/scmsvn/etc/plugins/scmsvn/config.php
---- gforge~/plugins/scmsvn/etc/plugins/scmsvn/config.php	2010-05-03 21:30:18.000000000 +0200
-+++ gforge/plugins/scmsvn/etc/plugins/scmsvn/config.php	2010-05-26 21:17:23.000000000 +0200
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gforge~/plugins/scmsvn/etc/plugins/scmsvn/config.php gforge/plugins/scmsvn/etc/plugins/scmsvn/config.php
+--- gforge~/plugins/scmsvn/etc/plugins/scmsvn/config.php	2010-06-03 13:39:24.000000000 +0200
++++ gforge/plugins/scmsvn/etc/plugins/scmsvn/config.php	2010-06-03 16:59:44.000000000 +0200
 @@ -3,8 +3,8 @@
  //$default_svn_server = forge_get_config('web_host') ;
  //$default_svn_server = "svn." . forge_get_config('web_host') ;
@@ -19,36 +19,17 @@
  $use_ssl = true;
  // $svn_root = forge_get_config('chroot').'/scmrepos/svn' ;
  
-diff -urNad gforge~/plugins/scmsvn/etc/plugins/scmsvn/config.php.~1~ gforge/plugins/scmsvn/etc/plugins/scmsvn/config.php.~1~
---- gforge~/plugins/scmsvn/etc/plugins/scmsvn/config.php.~1~	1970-01-01 01:00:00.000000000 +0100
-+++ gforge/plugins/scmsvn/etc/plugins/scmsvn/config.php.~1~	2010-05-26 21:17:23.000000000 +0200
-@@ -0,0 +1,18 @@
-+<?php
-+ 
-+//$default_svn_server = forge_get_config('web_host') ;
-+//$default_svn_server = "svn." . forge_get_config('web_host') ;
-+$default_svn_server = forge_get_config('scm_host');
-+$use_ssh = false;
-+$use_dav = true;
-+$use_ssl = true;
-+// $svn_root = forge_get_config('chroot').'/scmrepos/svn' ;
-+
-+$svn_bin = "/usr/bin/svn";
-+
-+// Local Variables:
-+// mode: php
-+// c-file-style: "bsd"
-+// End:
-+ 
-+?>
-diff -urNad gforge~/plugins/scmsvn/etc/scmsvn.ini gforge/plugins/scmsvn/etc/scmsvn.ini
---- gforge~/plugins/scmsvn/etc/scmsvn.ini	2010-05-26 21:14:09.000000000 +0200
-+++ gforge/plugins/scmsvn/etc/scmsvn.ini	2010-05-26 21:17:49.000000000 +0200
-@@ -1,4 +1,4 @@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gforge~/plugins/scmsvn/etc/scmsvn.ini gforge/plugins/scmsvn/etc/scmsvn.ini
+--- gforge~/plugins/scmsvn/etc/scmsvn.ini	2010-06-03 16:56:59.000000000 +0200
++++ gforge/plugins/scmsvn/etc/scmsvn.ini	2010-06-03 16:59:45.000000000 +0200
+@@ -1,8 +1,8 @@
  [scmsvn]
+ 
 -use_dav = yes
--use_ssl = yes
--use_ssh = no
 +use_dav = no
-+use_ssl = no
+ use_ssl = "$core/use_ssl"
+-use_ssh = no
 +use_ssh = yes
+ anonsvn_login = anonsvn
+ anonsvn_password = anonsvn
+ default_server = "$core/web_host"

Modified: trunk/gforge/plugins/scmsvn/etc/scmsvn.ini
===================================================================
--- trunk/gforge/plugins/scmsvn/etc/scmsvn.ini	2010-06-03 13:59:01 UTC (rev 9990)
+++ trunk/gforge/plugins/scmsvn/etc/scmsvn.ini	2010-06-03 15:02:33 UTC (rev 9991)
@@ -1,7 +1,7 @@
 [scmsvn]
 
 use_dav = yes
-use_ssl = yes
+use_ssl = "$core/use_ssl"
 use_ssh = no
 anonsvn_login = anonsvn
 anonsvn_password = anonsvn




More information about the Fusionforge-commits mailing list