Commit b98e2aca authored by Leo Gordon's avatar Leo Gordon
Browse files

removed rearrange() from DBAdaptor

parent 25e17d9a
...@@ -36,7 +36,6 @@ package Bio::EnsEMBL::Hive::DBSQL::DBAdaptor; ...@@ -36,7 +36,6 @@ package Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
use strict; use strict;
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use Bio::EnsEMBL::Utils::Exception ('throw'); use Bio::EnsEMBL::Utils::Exception ('throw');
use Bio::EnsEMBL::Hive::DBSQL::DBConnection; use Bio::EnsEMBL::Hive::DBSQL::DBConnection;
...@@ -44,10 +43,11 @@ use Bio::EnsEMBL::Hive::DBSQL::SqlSchemaAdaptor; ...@@ -44,10 +43,11 @@ use Bio::EnsEMBL::Hive::DBSQL::SqlSchemaAdaptor;
sub new { sub new {
my ($class, @args) = @_; my $class = shift @_;
my %flags = @_;
my ($dbconn, $url, $reg_conf, $reg_type, $reg_alias, $species, $no_sql_schema_version_check) my ($dbc, $url, $reg_conf, $reg_type, $reg_alias, $species, $no_sql_schema_version_check)
= rearrange(['DBCONN', 'URL', 'REG_CONF', 'REG_TYPE', 'REG_ALIAS', 'SPECIES', 'NO_SQL_SCHEMA_VERSION_CHECK'], @args); = @flags{qw(-dbconn -url -reg_conf -reg_type -reg_alias -species -no_sql_schema_version_check)};
$url .= ';nosqlvc=1' if($url && $no_sql_schema_version_check); $url .= ';nosqlvc=1' if($url && $no_sql_schema_version_check);
...@@ -55,7 +55,7 @@ sub new { ...@@ -55,7 +55,7 @@ sub new {
if($url) { if($url) {
$dbconn = Bio::EnsEMBL::Hive::DBSQL::DBConnection->new(-url => $url) $dbc = Bio::EnsEMBL::Hive::DBSQL::DBConnection->new(-url => $url)
or die "Unable to create a DBC using url='$url'"; or die "Unable to create a DBC using url='$url'";
} elsif($reg_alias) { } elsif($reg_alias) {
...@@ -69,14 +69,14 @@ sub new { ...@@ -69,14 +69,14 @@ sub new {
or die "Unable to connect to DBA using reg_conf='$reg_conf', reg_type='$reg_type', reg_alias='$reg_alias'\n"; or die "Unable to connect to DBA using reg_conf='$reg_conf', reg_type='$reg_type', reg_alias='$reg_alias'\n";
if($reg_type ne 'hive') { # ensure we are getting a Hive adaptor even from a non-Hive Registry entry: if($reg_type ne 'hive') { # ensure we are getting a Hive adaptor even from a non-Hive Registry entry:
$dbconn = $self->dbc; $dbc = $self->dbc;
$self = undef; $self = undef;
} }
} }
if($dbconn && !$self) { if($dbc && !$self) {
$self = bless {}, $class; $self = bless {}, $class;
$self->dbc( $dbconn ); $self->dbc( $dbc );
} }
unless($no_sql_schema_version_check) { unless($no_sql_schema_version_check) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment