Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
provision
Commits
80d2cf6f
Commit
80d2cf6f
authored
May 28, 2010
by
drumm
Committed by
Neil Drumm
May 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Less-circouitous db init.
parent
e3c9da7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
24 deletions
+1
-24
db/db.drush.inc
db/db.drush.inc
+1
-24
No files found.
db/db.drush.inc
View file @
80d2cf6f
...
...
@@ -30,32 +30,10 @@ function db_drush_help($section) {
class
provisionService_db
extends
provisionService
{
function
init
()
{
$this
->
setProperty
(
'master_db'
);
$db
=
parse_url
(
$this
->
master_db
);
$this
->
setProperty
(
'master_db_user'
,
urldecode
(
$db
[
'user'
]));
$this
->
setProperty
(
'master_db_passwd'
,
urldecode
(
$db
[
'pass'
]));
$this
->
setProperty
(
'master_db_host'
,
urldecode
(
$db
[
'host'
]));
$this
->
setProperty
(
'db_host'
,
urldecode
(
$db
[
'host'
]));
$this
->
creds
=
array_map
(
'urldecode'
,
parse_url
(
$this
->
master_db
));
$this
->
setProperty
(
'master_db_type'
,
$db
[
'scheme'
]);
$this
->
setProperty
(
'db_type'
,
$db
[
'scheme'
]);
$creds
=
array
();
$options
=
array
(
'master_db_user'
=>
'user'
,
'master_db_passwd'
=>
'pass'
,
'master_db_host'
=>
'host'
,
'master_db_type'
=>
'type'
,
);
foreach
(
$options
as
$option
=>
$key
)
{
$creds
[
$key
]
=
$this
->
$option
;
}
$this
->
creds
=
$creds
;
return
TRUE
;
}
...
...
@@ -281,7 +259,6 @@ class provisionService_db_pdo extends provisionService_db {
function
init
()
{
parent
::
init
();
$this
->
dsn
=
sprintf
(
"%s:dbname=%s;host=%s"
,
$this
->
PDO_type
,
$this
->
creds
[
'name'
],
$this
->
creds
[
'host'
]);
$this
->
dsn
=
sprintf
(
"%s:host=%s"
,
$this
->
PDO_type
,
$this
->
creds
[
'host'
]);
}
...
...
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