2 # Show options related to MySQL and other database connections
4 require './phpini-lib.pl';
6 &can_php_config($in{'file'}) || &error($text{'list_ecannot'});
7 $conf = &get_config($in{'file'});
9 &ui_print_header("<tt>$in{'file'}</tt>", $text{'db_title'}, "");
10 @tds = ( "width=30%" );
12 print &ui_form_start("save_db.cgi", "post");
13 print &ui_hidden("file", $in{'file'}),"\n";
15 # First section is for MySQL options
16 print &ui_table_start($text{'db_header1'}, "width=100%", 2);
18 # Allow persistent MySQL connections
19 print &ui_table_row($text{'db_persist'},
20 &onoff_radio("mysql.allow_persistent"),
23 # Max persistent connections
24 $mp = &find_value("mysql.max_persistent", $conf);
25 print &ui_table_row($text{'db_maxpersist'},
26 &ui_opt_textbox("mysql.max_persistent", $mp <= 0 ? undef : $mp,
27 5, $text{'db_unlimited'}),
30 # Max total connections
31 $mp = &find_value("mysql.max_links", $conf);
32 print &ui_table_row($text{'db_maxlinks'},
33 &ui_opt_textbox("mysql.max_links", $mp <= 0 ? undef : $mp,
34 5, $text{'db_unlimited'}),
38 $ct = &find_value("mysql.connect_timeout", $conf);
39 print &ui_table_row($text{'db_timeout'},
40 &ui_opt_textbox("mysql.connect_timeout", $ct <= 0 ? undef : $ct,
41 5,$text{'default'})." ".$text{'db_s'},
45 print &ui_table_row($text{'db_host'},
46 &ui_opt_textbox("mysql.default_host",
47 &find_value("mysql.default_host", $conf),
48 30, "<tt>localhost</tt>"),
52 print &ui_table_row($text{'db_port'},
53 &ui_opt_textbox("mysql.default_port",
54 &find_value("mysql.default_port", $conf),
58 print &ui_table_end();
61 # Second section is for PostgreSQL options
62 print &ui_table_start($text{'db_header2'}, "width=100%", 2);
64 # Allow persistent PostgreSQL connections
65 print &ui_table_row($text{'db_persist'},
66 &onoff_radio("pgsql.allow_persistent"),
69 # Re-open persistent PostgreSQL connections
70 print &ui_table_row($text{'db_reset'},
71 &onoff_radio("pgsql.auto_reset_persistent"),
74 # Max persistent connections
75 $mp = &find_value("pgsql.max_persistent", $conf);
76 print &ui_table_row($text{'db_maxpersist'},
77 &ui_opt_textbox("pgsql.max_persistent", $mp <= 0 ? undef : $mp,
78 5, $text{'db_unlimited'}),
81 # Max total connections
82 $mp = &find_value("pgsql.max_links", $conf);
83 print &ui_table_row($text{'db_maxlinks'},
84 &ui_opt_textbox("pgsql.max_links", $mp <= 0 ? undef : $mp,
85 5, $text{'db_unlimited'}),
89 print &ui_table_end();
91 print &ui_form_end([ [ "save", $text{'save'} ] ]);
93 &ui_print_footer("list_ini.cgi?file=".&urlize($in{'file'}),
94 $text{'list_return'});