2007-04-12 20:24:50 +00:00
|
|
|
#!/usr/local/bin/perl
|
|
|
|
# Show options related to MySQL and other database connections
|
|
|
|
|
|
|
|
require './phpini-lib.pl';
|
|
|
|
&ReadParse();
|
|
|
|
&can_php_config($in{'file'}) || &error($text{'list_ecannot'});
|
|
|
|
$conf = &get_config($in{'file'});
|
|
|
|
|
2024-11-23 22:05:43 -08:00
|
|
|
&ui_print_header("<tt>".&html_escape($in{'file'})."</tt>",
|
|
|
|
$text{'db_title'}, "");
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
print &ui_form_start("save_db.cgi", "post");
|
|
|
|
print &ui_hidden("file", $in{'file'}),"\n";
|
|
|
|
|
|
|
|
# First section is for MySQL options
|
|
|
|
print &ui_table_start($text{'db_header1'}, "width=100%", 2);
|
|
|
|
|
|
|
|
# Allow persistent MySQL connections
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_persist'}, 'mysql.allow_persistent'),
|
2024-11-23 22:05:43 -08:00
|
|
|
&onoff_radio("mysql.allow_persistent"));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Max persistent connections
|
|
|
|
$mp = &find_value("mysql.max_persistent", $conf);
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_maxpersist'}, 'mysql.max_persistent'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("mysql.max_persistent", $mp <= 0 ? undef : $mp,
|
2024-11-23 22:05:43 -08:00
|
|
|
5, $text{'db_unlimited'}));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Max total connections
|
|
|
|
$mp = &find_value("mysql.max_links", $conf);
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_maxlinks'}, 'mysql.max_links'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("mysql.max_links", $mp <= 0 ? undef : $mp,
|
2024-11-23 22:05:43 -08:00
|
|
|
5, $text{'db_unlimited'}));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Connection timeout
|
|
|
|
$ct = &find_value("mysql.connect_timeout", $conf);
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_timeout'}, 'mysql.connect_timeout'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("mysql.connect_timeout", $ct <= 0 ? undef : $ct,
|
2024-11-23 22:05:43 -08:00
|
|
|
5,$text{'default'})." ".$text{'db_s'});
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Default host
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_host'}, 'mysql.default_host'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("mysql.default_host",
|
|
|
|
&find_value("mysql.default_host", $conf),
|
2024-11-23 22:05:43 -08:00
|
|
|
30, "<tt>localhost</tt>"));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Default port
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_port'}, 'mysql.default_port'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("mysql.default_port",
|
|
|
|
&find_value("mysql.default_port", $conf),
|
2024-11-23 22:05:43 -08:00
|
|
|
5, "<tt>3306</tt>"));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
print &ui_table_end();
|
|
|
|
|
|
|
|
|
|
|
|
# Second section is for PostgreSQL options
|
|
|
|
print &ui_table_start($text{'db_header2'}, "width=100%", 2);
|
|
|
|
|
|
|
|
# Allow persistent PostgreSQL connections
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_persist'}, 'pgsql.allow_persistent'),
|
2024-11-23 22:05:43 -08:00
|
|
|
&onoff_radio("pgsql.allow_persistent"));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Re-open persistent PostgreSQL connections
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_reset'}, 'pgsql.auto_reset_persistent'),
|
2024-11-23 22:05:43 -08:00
|
|
|
&onoff_radio("pgsql.auto_reset_persistent"));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Max persistent connections
|
|
|
|
$mp = &find_value("pgsql.max_persistent", $conf);
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_maxpersist'}, 'pgsql.max_persistent'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("pgsql.max_persistent", $mp <= 0 ? undef : $mp,
|
2024-11-23 22:05:43 -08:00
|
|
|
5, $text{'db_unlimited'}));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
# Max total connections
|
|
|
|
$mp = &find_value("pgsql.max_links", $conf);
|
2023-07-16 15:05:51 +03:00
|
|
|
print &ui_table_row(&opt_help($text{'db_maxlinks'}, 'pgsql.max_links'),
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_opt_textbox("pgsql.max_links", $mp <= 0 ? undef : $mp,
|
2024-11-23 22:05:43 -08:00
|
|
|
5, $text{'db_unlimited'}));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
print &ui_table_end();
|
|
|
|
|
|
|
|
print &ui_form_end([ [ "save", $text{'save'} ] ]);
|
|
|
|
|
|
|
|
&ui_print_footer("list_ini.cgi?file=".&urlize($in{'file'}),
|
|
|
|
$text{'list_return'});
|