[Fusionforge-commits] r9497 - in trunk: gforge/common/include gforge/plugins/scmarch/common gforge/plugins/scmbzr/common gforge/plugins/scmcvs/common gforge/plugins/scmdarcs/common gforge/plugins/scmgit/common gforge/plugins/scmhg/common gforge/plugins/scmsvn/common gforge/www gforge/www/include tests/code/deprecations tools

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Apr 15 10:48:35 CEST 2010


Author: lolando
Date: 2010-04-15 10:48:35 +0200 (Thu, 15 Apr 2010)
New Revision: 9497

Modified:
   trunk/gforge/common/include/SCMPlugin.class.php
   trunk/gforge/plugins/scmarch/common/ArchPlugin.class.php
   trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php
   trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php
   trunk/gforge/plugins/scmdarcs/common/DarcsPlugin.class.php
   trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
   trunk/gforge/plugins/scmhg/common/HgPlugin.class.php
   trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php
   trunk/gforge/www/include/pre.php
   trunk/gforge/www/snapshots.php
   trunk/gforge/www/tarballs.php
   trunk/tests/code/deprecations/DeprecationsTest.php
   trunk/tools/unify_config.sh
Log:
Config API: sys_scm_{tarballs,snapshots}_path migrated to core/scm_foo_path

Modified: trunk/gforge/common/include/SCMPlugin.class.php
===================================================================
--- trunk/gforge/common/include/SCMPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/common/include/SCMPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -160,7 +160,7 @@
 	}
 
 	function printPage ($params) {
-		global $HTML, $sys_scm_snapshots_path;
+		global $HTML;
 
 		$project = $this->checkParams ($params) ;
 		if (!$project) {

Modified: trunk/gforge/plugins/scmarch/common/ArchPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmarch/common/ArchPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmarch/common/ArchPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -77,9 +77,9 @@
 	}
 
 	function generateSnapshots ($params) {
-		global $sys_scm_snapshots_path ;
-		global $sys_scm_tarballs_path ;
 
+
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -87,8 +87,8 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$snapshot = $sys_scm_snapshots_path.'/'.$group_name.'-scm-latest.tar.gz';
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$snapshot = forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -403,9 +403,9 @@
 	}
 
 	function generateSnapshots ($params) {
-		global $sys_scm_snapshots_path ;
-		global $sys_scm_tarballs_path ;
 
+
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -413,8 +413,8 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$snapshot = $sys_scm_snapshots_path.'/'.$group_name.'-scm-latest.tar.gz';
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$snapshot = forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -108,10 +108,10 @@
 	}
 
 	function getSnapshotPara ($project) {
-		global $sys_scm_snapshots_path ;
+
 		$b = "" ;
 		$filename = $project->getUnixName().'-scm-latest.tar.gz';
-		if (file_exists($sys_scm_snapshots_path.'/'.$filename)) {
+		if (file_exists(forge_get_config('scm_snapshots_path').'/'.$filename)) {
 			$b .= '<p>[' ;
 			$b .= util_make_link ("/snapshots.php?group_id=".$project->getID(),
 					      _('Download the nightly snapshot')
@@ -365,9 +365,9 @@
 	}
 
 	function generateSnapshots ($params) {
-		global $sys_scm_snapshots_path ;
-		global $sys_scm_tarballs_path ;
 
+
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -375,8 +375,8 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$snapshot = $sys_scm_snapshots_path.'/'.$group_name.'-scm-latest.tar.gz';
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$snapshot = forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/plugins/scmdarcs/common/DarcsPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmdarcs/common/DarcsPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmdarcs/common/DarcsPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -88,10 +88,10 @@
 	}
 
 	function getSnapshotPara ($project) {
-		global $sys_scm_snapshots_path ;
+
 		$b = "" ;
 		$filename = $project->getUnixName().'-scm-latest.tar.gz';
-		if (file_exists($sys_scm_snapshots_path.'/'.$filename)) {
+		if (file_exists(forge_get_config('scm_snapshots_path').'/'.$filename)) {
 			$b .= '<p>[' ;
 			$b .= util_make_link ("/snapshots.php?group_id=".$project->getID(),
 					      _('Download the nightly snapshot')
@@ -235,8 +235,8 @@
 	}
 
 	function generateSnapshots ($params) {
-		global $sys_scm_tarballs_path ;
 
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -244,7 +244,7 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -138,10 +138,10 @@
 	}
 
 	function getSnapshotPara ($project) {
-		global $sys_scm_snapshots_path ;
+
 		$b = "" ;
 		$filename = $project->getUnixName().'-scm-latest.tar.gz';
-		if (file_exists($sys_scm_snapshots_path.'/'.$filename)) {
+		if (file_exists(forge_get_config('scm_snapshots_path').'/'.$filename)) {
 			$b .= '<p>[' ;
 			$b .= util_make_link ("/snapshots.php?group_id=".$project->getID(),
 					      _('Download the nightly snapshot')
@@ -364,8 +364,8 @@
         }
 
 	function generateSnapshots ($params) {
-		global $sys_scm_tarballs_path ;
 
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -373,8 +373,8 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$snapshot = $sys_scm_snapshots_path.'/'.$group_name.'-scm-latest.tar.gz';
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$snapshot = forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/plugins/scmhg/common/HgPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmhg/common/HgPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmhg/common/HgPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -111,8 +111,8 @@
 	}
 
 	function generateSnapshots ($params) {
-		global $sys_scm_tarballs_path ;
 
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -120,7 +120,7 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -412,9 +412,9 @@
 	}
 
 	function generateSnapshots ($params) {
-		global $sys_scm_snapshots_path ;
-		global $sys_scm_tarballs_path ;
 
+
+
 		$project = $this->checkParams ($params) ;
 		if (!$project) {
 			return false ;
@@ -422,8 +422,8 @@
 		
 		$group_name = $project->getUnixName() ;
 
-		$snapshot = $sys_scm_snapshots_path.'/'.$group_name.'-scm-latest.tar.gz';
-		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
+		$snapshot = forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar.gz';
+		$tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
 			return false;

Modified: trunk/gforge/www/include/pre.php
===================================================================
--- trunk/gforge/www/include/pre.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/www/include/pre.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -37,6 +37,8 @@
 forge_define_config_item ('forge_name', 'core', $GLOBALS['sys_name']) ;
 forge_define_config_item ('user_registration_restricted', 'core', $GLOBALS['sys_user_reg_restricted']) ;
 forge_define_config_item ('web_host', 'core', $GLOBALS['sys_default_domain']) ;
+forge_define_config_item ('scm_tarballs_path', 'core', $GLOBALS['sys_scm_tarballs_path']) ;
+forge_define_config_item ('scm_snapshots_path', 'core', $GLOBALS['sys_scm_snapshots_path']) ;
 // forge_define_config_item ('', 'core', $GLOBALS['sys_']) ;
 
 /* Long-term:

Modified: trunk/gforge/www/snapshots.php
===================================================================
--- trunk/gforge/www/snapshots.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/www/snapshots.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -45,13 +45,13 @@
 
 $filename=$group_name.'-scm-latest.tar.gz';
 
-if (file_exists($sys_scm_snapshots_path.'/'.$filename)) {
+if (file_exists(forge_get_config('scm_snapshots_path').'/'.$filename)) {
 	Header('Content-disposition: filename="'.str_replace('"', '', $filename).'"');
 	Header('Content-type: application/x-gzip');
-	$length = filesize($sys_scm_snapshots_path.'/'.$filename);
+	$length = filesize(forge_get_config('scm_snapshots_path').'/'.$filename);
 	Header('Content-length: '.$length);
 
-	readfile_chunked($sys_scm_snapshots_path.'/'.$filename);
+	readfile_chunked(forge_get_config('scm_snapshots_path').'/'.$filename);
 } else {
 	session_redirect(util_make_url('/404.php'));
 }

Modified: trunk/gforge/www/tarballs.php
===================================================================
--- trunk/gforge/www/tarballs.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/gforge/www/tarballs.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -41,13 +41,13 @@
 
 $filename=$group_name.'-scmroot.tar.gz';
 
-if (file_exists($sys_scm_tarballs_path.'/'.$filename)) {
+if (file_exists(forge_get_config('scm_tarballs_path').'/'.$filename)) {
 	Header('Content-disposition: filename="'.str_replace('"', '', $filename).'"');
 	Header("Content-type: application/x-gzip");
-	$length = filesize($sys_scm_tarballs_path.'/'.$filename);
+	$length = filesize(forge_get_config('scm_tarballs_path').'/'.$filename);
 	Header("Content-length: ".$length);
 
-	readfile_chunked($sys_scm_tarballs_path.'/'.$filename);
+	readfile_chunked(forge_get_config('scm_tarballs_path').'/'.$filename);
 } else {
 	session_redirect(util_make_url("/404.php"));
 }

Modified: trunk/tests/code/deprecations/DeprecationsTest.php
===================================================================
--- trunk/tests/code/deprecations/DeprecationsTest.php	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/tests/code/deprecations/DeprecationsTest.php	2010-04-15 08:48:35 UTC (rev 9497)
@@ -33,7 +33,9 @@
 	{
 		$vars = array ('sys_name',
 			       'sys_user_reg_restricted',
-			       'sys_default_domain') ;
+			       'sys_default_domain',
+			       'sys_scm_tarballs_path',
+			       'sys_scm_snapshots_path') ;
 
 		$pattern = implode ('|', $vars) ;
 		

Modified: trunk/tools/unify_config.sh
===================================================================
--- trunk/tools/unify_config.sh	2010-04-14 20:33:59 UTC (rev 9496)
+++ trunk/tools/unify_config.sh	2010-04-15 08:48:35 UTC (rev 9497)
@@ -17,8 +17,10 @@
     ack-grep -l --php $old | grep -v www/include/pre.php
 }
 
-find_files | xargs perl -pi -e"s/(\\s*global .*)\\\$$old, */\\1/"
-find_files | xargs perl -pi -e"s/(\\s*global .*)\\\$$old *;//"
-find_files | xargs perl -pi -e"s,\\\$GLOBALS\['$old'\](?"\!"\\s*=),$newstr,g"
-find_files | xargs perl -pi -e"s,\\\$GLOBALS\[$old\](?"\!"\\s*=),$newstr,g"
-find_files | xargs perl -pi -e"s,\\\$$old(?"\!"\\s*=),$newstr,g"
+find_files | xargs perl -pi -e"
+s/^\\s*global +\\\$$old *;//;
+s/^(\\s*global +)\\\$$old *,/\\1/;
+s/^(\\s*global .*), *\\\$$old/\\1/;
+s,\\\$GLOBALS\['$old'\](?"\!"\\s*=),$newstr,g;
+s,\\\$GLOBALS\[$old\](?"\!"\\s*=),$newstr,g;
+s,\\\$$old(?"\!"\\s*=),$newstr,g"




More information about the Fusionforge-commits mailing list