From: Steinar H. Gunderson Date: Sun, 17 Jul 2005 14:59:44 +0000 (+0000) Subject: Move the database config into config.pm. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=2b281b9236c2b6aae61081717ea6210900f0dbbe Move the database config into config.pm. --- diff --git a/config.pm b/config.pm index 1354475..cfb12ba 100644 --- a/config.pm +++ b/config.pm @@ -12,5 +12,11 @@ our $dbdebug = 0; # Set this flag to disable any admin tasks -- it's quite crude, but hey :-) our $noadmin = 0; +# The database connection details +our $dbname = "ccbs"; +our $dbhost = "www.positivegaming.com"; +our $dbuser = "ccbs"; +our $dbpass = "GeT|>>B_"; + 1; diff --git a/html/ccbs.pm b/html/ccbs.pm index 3fdf3a5..cd71ce8 100755 --- a/html/ccbs.pm +++ b/html/ccbs.pm @@ -41,7 +41,7 @@ sub print_see_other { } sub db_connect { - my $dbh = DBI->connect("dbi:Pg:dbname=ccbs;host=www.positivegaming.com", "ccbs", "GeT|>>B_") + my $dbh = DBI->connect("dbi:Pg:dbname=$ccbs::config::dbname;host=$ccbs::config::dbhost", $ccbs::config::dbuser, $ccbs::config::dbpass) or die "Couldn't connect to database"; $dbh->{RaiseError} = 1; return $dbh;