mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 367836: Let the shadowdb connection have its own username and password
r=bear
This commit is contained in:
parent
0a01963833
commit
84cc24b8de
@ -136,6 +136,11 @@ DefParam("cvsadmin",
|
||||
"t",
|
||||
'%maintainer%');
|
||||
|
||||
DefParam("dbiparam",
|
||||
"The first parameter to pass to the DBI->connect() method.<br>Example: <code>DBI:mysql:host=localhost;database=bonsai</code>",
|
||||
"t",
|
||||
"DBI:mysql:database=bonsai;");
|
||||
|
||||
DefParam("mysqluser",
|
||||
"The username of the bonsai database user.",
|
||||
"t",
|
||||
@ -146,16 +151,21 @@ DefParam("mysqlpassword",
|
||||
"p",
|
||||
"");
|
||||
|
||||
DefParam("dbiparam",
|
||||
"The first parameter to pass to the DBI->connect() method.<br>Example: <code>DBI:mysql:host=localhost;database=bonsai</code>",
|
||||
"t",
|
||||
"DBI:mysql:database=bonsai;");
|
||||
|
||||
DefParam("shadowdbiparam",
|
||||
"The first parameter to pass to the DBI->connect() method of a read-only replicated slave database to use for queries, to help with performance on high-traffic systems. If left blank, queries will be made against the primary database and this param will be ignored.<br>Example: <code>DBI:mysql:host=slaveserver;database=bonsai</code>",
|
||||
"t",
|
||||
"");
|
||||
|
||||
DefParam("shadowmysqluser",
|
||||
"The username of the bonsai database user for the shadow database.",
|
||||
"t",
|
||||
"nobody");
|
||||
|
||||
DefParam("shadowmysqlpassword",
|
||||
"The password of the bonsai database user for the shadow database.",
|
||||
"p",
|
||||
"");
|
||||
|
||||
DefParam("readonly",
|
||||
"Are the hook files readonly. (This value gets changed on the fly,
|
||||
so it is ok to leave the way it is.)",
|
||||
|
@ -109,11 +109,18 @@ sub ConnectToDatabase {
|
||||
my ($dsn);
|
||||
|
||||
if (!defined $::readdb) {
|
||||
$dsn = Param('shadowdbiparam') || Param('dbiparam');
|
||||
my $dsn = Param('dbiparam');
|
||||
my $dbuser = Param('mysqluser');
|
||||
my $dbpass = Param('mysqlpassword');
|
||||
if (Param('shadowdbiparam')) {
|
||||
$dsn = Param('shadowdbiparam');
|
||||
$dbuser = Param('shadowmysqluser');
|
||||
$dbpass = Param('shadowmysqlpassword');
|
||||
}
|
||||
|
||||
# DBI->trace(1, "/tmp/dbi.out");
|
||||
|
||||
$::readdb = DBI->connect($dsn, Param('mysqluser'), Param('mysqlpassword'))
|
||||
$::readdb = DBI->connect($dsn, $dbuser, $dbpass)
|
||||
|| die "Can't connect to database server.";
|
||||
$::db = $::readdb;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user