[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Tue Jun 10 17:12:53 UTC 2003


mwilkinson
Tue Jun 10 13:12:52 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv31276/MOBY

Modified Files:
	Central.pm central_db_connection.pm 
Log Message:
Both client and server now use (if available) environment variables to set their default connection parameters.  This is described in the INSTALL file that I just added.  I will also be updating the HTML page on the biomoby website to indicate these changes

moby-live/Perl/MOBY Central.pm,1.72,1.73 central_db_connection.pm,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/06/09 23:47:59	1.72
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/06/10 17:12:52	1.73
@@ -145,18 +145,24 @@
 }
 
 sub _dbAccess {
-    my $filename = "./MOBY/central.cfg";# $self->config;
-	$debug && &_LOG("trying to open file $filename\n");
-	open (IN, $filename) || die "can't open configuration file $filename:  $!";
-	my $url = <IN>; chomp $url;
-	my $dbname = <IN>; chomp $dbname;
-	my $username = <IN>; chomp $username;
-	my $password = <IN>; chomp $password;
 	
-	my ($dsn) = "DBI:mysql:$dbname:$url";
+# this configuration system was stoopid and is now defunkt.
+	
+#    my $filename = "./MOBY/central.cfg";# $self->config;
+#	$debug && &_LOG("trying to open file $filename\n");
+#	open (IN, $filename) || die "can't open configuration file $filename:  $!";
+#	my $url = <IN>; chomp $url;
+#	my $dbname = <IN>; chomp $dbname;
+#	my $username = <IN>; chomp $username;
+#	my $password = <IN>; chomp $password;
+	my $url = $ENV{MOBY_CENTRAL_URL}; chomp $url;
+	my $dbname = $ENV{MOBY_CENTRAL_DBNAME}; chomp $dbname;
+	my $username = $ENV{MOBY_CENTRAL_DBUSER}; chomp $username;
+	my $password = $ENV{MOBY_CENTRAL_DBPASS}; chomp $password;
+	my $port = $ENV{MOBY_CENTRAL_DBPORT}; chomp $port;
+	
+	my ($dsn) = "DBI:mysql:$dbname:$url:$port";
 	my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database";
-#	my $dsn = "DBI:mysql:mobycentral:localhost:3306";
-#	my $dbh = DBI->connect($dsn, 'root', undef, {RaiseError => 1}) or die "can't connect to database";
 	
 	return ($dbh);
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/central_db_connection.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/central_db_connection.pm	2003/05/07 19:20:27	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/central_db_connection.pm	2003/06/10 17:12:52	1.2
@@ -47,11 +47,11 @@
     my %_attr_data = #     				DEFAULT    	ACCESSIBILITY
                   (
         db_connect_object => ["MOBY::mysql",        'read/write'],
-        username => ["mobycentral",         'read/write'],
-        password => ["mobycentral",         'read/write'],        
-        dbname => ["mobycentral",       'read/write'],
-        host => ["localhost",         'read/write'],
-        port => [3306,         'read/write'],
+        #username => ["mobycentral",         'read/write'],
+        #password => ["mobycentral",         'read/write'],        
+        #dbname => ["mobycentral",       'read/write'],
+        #host => ["localhost",         'read/write'],
+        #port => [3306,         'read/write'],
         dbh => [undef,      'read/write'],
                               );
 
@@ -115,11 +115,18 @@
     #    $self->password,
     #    $self->host,
     #    $self->port);
-    my $dbname = $self->dbname;
-    my $host = $self->host;
-    my $port = $self->port;
-    my $username = $self->username;
-    my $password = $self->password;
+
+	my $host = $ENV{MOBY_CENTRAL_URL}; chomp $host;
+	my $dbname = $ENV{MOBY_CENTRAL_DBNAME}; chomp $dbname;
+	my $username = $ENV{MOBY_CENTRAL_DBUSER}; chomp $username;
+	my $password = $ENV{MOBY_CENTRAL_DBPASS}; chomp $password;
+    my $port = $ENV{MOBY_CENTRAL_DBPORT}; chomp $port;
+    
+    #my $dbname = $self->dbname;
+    #my $host = $self->host;
+    #my $port = $self->port;
+    #my $username = $self->username;
+    #my $password = $self->password;
     my ($dsn) = "DBI:mysql:$dbname:$host:$port";
 
     my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database";




More information about the MOBY-guts mailing list