Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
3f09f950
Commit
3f09f950
authored
Nov 03, 2004
by
Steve Trevanion
Browse files
fixed change_access
parent
9f90d0b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
modules/Bio/EnsEMBL/Registry.pm
modules/Bio/EnsEMBL/Registry.pm
+17
-18
No files found.
modules/Bio/EnsEMBL/Registry.pm
View file @
3f09f950
...
...
@@ -68,7 +68,7 @@ my $exon_adaptor = Bio::EnsEMBL::Registry->get_adaptor("Human","core","Exon");
=head2 DNA
This is an internal Registry and allows the configuration of a dnadb.
An example here is to set the est database to get it
'
s dna data from the core database.
An example here is to set the est database to get its dna data from the core database.
## set the est db to use the core for getting dna data.
#Bio::EnsEMBL::Utils::ConfigRegistry->
...
...
@@ -639,24 +639,23 @@ sub set_disconnect_when_inactive{
=cut
sub
change_access
{
my
(
$host
,
$port
,
$user
,
$dbname
,
$new_user
,
$new_pass
)
=
@_
;
foreach
my
$dba
(
@
{
$registry_register
{'
_DBA
'}}){
my
$dbc
=
$dba
->
dbc
;
if
((
!
defined
(
$host
)
or
$host
eq
$dbc
->
host
)
and
(
!
defined
(
$port
)
or
$port
eq
$dbc
->
port
)
and
(
!
defined
(
$user
)
or
$user
eq
$dbc
->
username
)
and
(
!
defined
(
$dbname
)
or
$
host
eq
$dbc
->
dbname
)){
#disconnect if
connected
if
(
$dbc
->
connect
ed
()){
$dbc
->
dis
connect
(
);
$dbc
->
connected
(
undef
);
}
# over write the username and password
$dbc
->
username
(
$new_
user
);
$dbc
->
password
(
$new_pass
);
my
$self
=
shift
;
my
(
$host
,
$port
,
$user
,
$dbname
,
$new_user
,
$new_pass
)
=
@_
;
foreach
my
$dba
(
@
{
$registry_register
{'
_DBA
'}}){
my
$dbc
=
$dba
->
dbc
;
if
((
!
defined
(
$host
)
or
$host
eq
$dbc
->
host
)
and
(
!
defined
(
$port
)
or
$port
eq
$dbc
->
port
)
and
(
!
defined
(
$user
)
or
$user
eq
$dbc
->
username
)
and
(
!
defined
(
$dbname
)
or
$
dbname
eq
$dbc
->
dbname
)){
if
(
$dbc
->
connected
()){
$dbc
->
db_handle
->
dis
connect
();
$dbc
->
connect
ed
(
undef
);
}
# over write the username and password
$dbc
->
username
(
$new_user
);
$dbc
->
password
(
$new_
pass
);
}
}
}
}
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment