4 * FusionForge source control management
6 * Copyright 2009, Roland Mas
8 * This file is part of FusionForge.
10 * FusionForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published
12 * by the Free Software Foundation; either version 2 of the License,
13 * or (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FusionForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 require (dirname(__FILE__).'/../common/include/env.inc.php');
27 require_once $gfcommon.'include/pre.php';
29 if (count ($argv) == 3) {
30 $v = forge_get_config ($argv[1], $argv[2]) ;
33 } elseif ($v === false) {
37 } elseif (count($argv) == 2) {
38 if ($argv[1] == 'list-all-variables') {
39 $c = FusionForgeConfig::get_instance () ;
40 $sections = $c->get_sections() ;
41 foreach ($sections as $s) {
42 $variables = $c->get_variables($s) ;
43 foreach ($variables as $v) {
47 } elseif ($argv[1] == 'list-all-variables-values') {
48 $c = FusionForgeConfig::get_instance () ;
49 $sections = $c->get_sections() ;
50 foreach ($sections as $s) {
51 $variables = $c->get_variables($s) ;
52 foreach ($variables as $v) {
53 $value = forge_get_config ($v, $s);
54 print "$s/$v: $value\n" ;
58 $v = forge_get_config ($argv[1]) ;
61 } elseif ($v === false) {
67 echo "Usage: .../forge-get-config <variable> [ <section> ]
68 For instance: .../forge-get-config web_host
69 .../forge-get-config repo_prefix scmsvn
71 Or: .../forge-get-config list-all-variables, for all variables
72 .../forge-get-config list-all-variables-values, for all variables and their values
79 // c-file-style: "bsd"