[Fusionforge-commits] r9508 - in trunk: gforge/common/include gforge/www/include tests/code/deprecations

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Apr 16 15:30:56 CEST 2010


Author: lolando
Date: 2010-04-16 15:30:56 +0200 (Fri, 16 Apr 2010)
New Revision: 9508

Added:
   trunk/gforge/common/include/config-vars.php
Modified:
   trunk/gforge/www/include/pre.php
   trunk/gforge/www/include/squal_pre.php
   trunk/tests/code/deprecations/DeprecationsTest.php
Log:
Factor configuration variable definitions

Added: trunk/gforge/common/include/config-vars.php
===================================================================
--- trunk/gforge/common/include/config-vars.php	                        (rev 0)
+++ trunk/gforge/common/include/config-vars.php	2010-04-16 13:30:56 UTC (rev 9508)
@@ -0,0 +1,39 @@
+<?php
+/**
+ * FusionForge configuration variables
+ *
+ * Copyright 2010, 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
+ */
+
+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:
+ require_once $gfcommon.'include/FusionForge.class.php';
+ $forge = new FusionForge() ;
+ forge_define_config_item ('forge_name', 'core', $forge->software_name) ;
+ forge_define_config_item ('user_registration_restricted', 'core', false) ;
+*/
+
+?>

Modified: trunk/gforge/www/include/pre.php
===================================================================
--- trunk/gforge/www/include/pre.php	2010-04-16 11:33:41 UTC (rev 9507)
+++ trunk/gforge/www/include/pre.php	2010-04-16 13:30:56 UTC (rev 9508)
@@ -33,20 +33,8 @@
 
 require $gfcgfile;
 require $gfcommon.'include/config.php';
+require $gfcommon.'include/config-vars.php';
 
-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:
- require_once $gfcommon.'include/FusionForge.class.php';
- $forge = new FusionForge() ;
- forge_define_config_item ('forge_name', 'core', $forge->software_name) ;
- forge_define_config_item ('user_registration_restricted', 'core', false) ;
-*/
 forge_read_config_file ($gfconfig.'/config.ini') ;
 
 // get constants used for flags or status

Modified: trunk/gforge/www/include/squal_pre.php
===================================================================
--- trunk/gforge/www/include/squal_pre.php	2010-04-16 11:33:41 UTC (rev 9507)
+++ trunk/gforge/www/include/squal_pre.php	2010-04-16 13:30:56 UTC (rev 9508)
@@ -21,20 +21,8 @@
 
 require $gfcgfile;
 require $gfcommon.'include/config.php';
+require $gfcommon.'include/config-vars.php';
 
-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:
- require_once $gfcommon.'include/FusionForge.class.php';
- $forge = new FusionForge() ;
- forge_define_config_item ('forge_name', 'core', $forge->software_name) ;
- forge_define_config_item ('user_registration_restricted', 'core', false) ;
-*/
 forge_read_config_file ($gfconfig.'/config.ini') ;
 
 require $gfcommon.'include/constants.php';

Modified: trunk/tests/code/deprecations/DeprecationsTest.php
===================================================================
--- trunk/tests/code/deprecations/DeprecationsTest.php	2010-04-16 11:33:41 UTC (rev 9507)
+++ trunk/tests/code/deprecations/DeprecationsTest.php	2010-04-16 13:30:56 UTC (rev 9508)
@@ -40,11 +40,11 @@
 		$pattern = implode ('|', $vars) ;
 		
 		$output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -n '\\$($pattern)\b(?! *=[^=])' \
-					   | grep -v ^gforge/www/include/pre.php`;
+					   | grep -v ^gforge/common/include/config-vars.php`;
 		$this->assertEquals('', $output, "Found deprecated \$var for var in ($pattern):");
 
 		$output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -n '\\\$GLOBALS\\[.?($pattern).?\\](?! *=[^=])' \
-					   | grep -v ^gforge/www/include/pre.php`;
+					   | grep -v ^gforge/common/include/config-vars.php`;
 		$this->assertEquals('', $output, "Found deprecated \$GLOBALS['\$var'] for var in ($pattern):");
 		
 	}




More information about the Fusionforge-commits mailing list