[Rt-commit] r11103 - rt/branches/3.8-TESTING/html/Install

ruz at bestpractical.com ruz at bestpractical.com
Tue Mar 18 11:37:41 EDT 2008


Author: ruz
Date: Tue Mar 18 11:37:40 2008
New Revision: 11103

Modified:
   rt/branches/3.8-TESTING/html/Install/index.html

Log:
* add simple config generating

Modified: rt/branches/3.8-TESTING/html/Install/index.html
==============================================================================
--- rt/branches/3.8-TESTING/html/Install/index.html	(original)
+++ rt/branches/3.8-TESTING/html/Install/index.html	Tue Mar 18 11:37:40 2008
@@ -77,7 +77,23 @@
         },
     },
 );
+my %META = @db_options;
 
+my $dump_config = sub {
+    my %data = @_;
+
+    my $res = '';
+
+    for ( my $i = 0; $i < @db_options; $i += 2 ) {
+        my $option = $db_options[$i];
+        next unless exists $data{ $option } && defined $data{ $option };
+        my $meta = $db_options[$i+1];
+        my $value = $data{ $option };
+        $res .= "Set(\$$option, '$value');\n";
+    }
+    $res .= "\n1;# don't delete this line\n";
+    return $res;
+};
 
 if ( $ARGS{'DatabaseCreate'} ) {
     my %config = ();
@@ -95,7 +111,6 @@
         $config{ $option } = scalar RT->Config->Get( $option )
             if !defined $value && $meta->{'WidgetArguments'}{'Default'};
     }
-    use Data::Dumper;
-    warn(Dumper(\%config));
+    warn($dump_config->(%config));
 }
 </%INIT>


More information about the Rt-commit mailing list