[Lxr-commits] CVS: lxr/lib/LXR/Index Mysql.pm,1.8,1.9
Brought to you by:
ajlittoz
|
From: Per K. G. <pe...@us...> - 2001-10-16 20:25:35
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index
In directory usw-pr-cvs1:/tmp/cvs-serv16465/lib/LXR/Index
Modified Files:
Mysql.pm
Log Message:
Database password and user can now be specified in lxr.conf
Index: Mysql.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Mysql.pm 2001/08/15 15:50:27 1.8
+++ Mysql.pm 2001/10/16 20:25:32 1.9
@@ -32,7 +32,14 @@
my ($self, $dbname) = @_;
$self = bless({}, $self);
- $self->{dbh} = DBI->connect($dbname, "lxr") || fatal "Can't open connection to database\n";
+ if(defined($config->{dbpass}) {
+ $self->{dbh} = DBI->connect($dbname, $config->{dbuser},
+ $config->{dbpass})
+ || fatal "Can't open connection to database\n";
+ } else {
+ $self->{dbh} = DBI->connect($dbname, "lxr", $config->{dbpass})
+ || fatal "Can't open connection to database\n";
+ }
%files = ();
%symcache = ();
@@ -262,7 +269,7 @@
}
sub DESTROY {
- my ($self) = @_;
+ my ($self) = @_;
$self->{files_select} = undef;
$self->{files_insert} = undef;
$self->{symbols_byname} = undef;
|