aboutsummaryrefslogtreecommitdiff
path: root/lib/MasterServer/Database/Pg/dbCore.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MasterServer/Database/Pg/dbCore.pm')
-rwxr-xr-xlib/MasterServer/Database/Pg/dbCore.pm44
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/MasterServer/Database/Pg/dbCore.pm b/lib/MasterServer/Database/Pg/dbCore.pm
deleted file mode 100755
index 5cd194b..0000000
--- a/lib/MasterServer/Database/Pg/dbCore.pm
+++ /dev/null
@@ -1,44 +0,0 @@
-
-package MasterServer::Database::Pg::dbCore;
-
-use strict;
-use warnings;
-use Exporter 'import';
-
-our @EXPORT = qw| database_login |;
-
-################################################################################
-## login to the database with credentials provided in the config file.
-## returns dbh object or quits application on error.
-################################################################################
-sub database_login {
- my $self = shift;
-
- # create the dbi object
- my $dbh = DBI->connect(@{$self->{dblogin}}, {PrintError => $self->{db_print}});
-
- # verify that the database connected
- if (defined $dbh) {
-
- # log the event
- $self->log("load","Connected to the Postgres database.");
-
- # turn on error printing
- $dbh->{printerror} = 1;
-
- # return the dbi object for further use
- return $dbh;
- }
- else {
- # fatal error
- $self->log("fatal", "$DBI::errstr!");
-
- # end program
- $self->halt();
- }
-
- # unreachable
- return undef;
-}
-
-1;