Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
6529e195
Commit
6529e195
authored
Jun 24, 2009
by
anarcat
Committed by
anarcat
Jun 24, 2009
Browse files
#494358
- fix site import for sites with funky characters in passwords
parent
cd1558d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
platform/drupal/import_5.inc
View file @
6529e195
...
...
@@ -8,11 +8,11 @@ else {
}
if
(
$parts
=
@
parse_url
(
$db_url
))
{
drush_set_option
(
'db_type'
,
$parts
[
'scheme'
],
'site'
);
drush_set_option
(
'db_user'
,
$parts
[
'user'
],
'site'
);
drush_set_option
(
'db_host'
,
$parts
[
'host'
],
'site'
);
drush_set_option
(
'db_passwd'
,
$parts
[
'pass'
],
'site'
);
drush_set_option
(
'db_name'
,
substr
(
$parts
[
'path'
],
1
),
'site'
);
drush_set_option
(
'db_type'
,
urldecode
(
$parts
[
'scheme'
]
)
,
'site'
);
drush_set_option
(
'db_user'
,
urldecode
(
$parts
[
'user'
]
)
,
'site'
);
drush_set_option
(
'db_host'
,
urldecode
(
$parts
[
'host'
]
)
,
'site'
);
drush_set_option
(
'db_passwd'
,
urldecode
(
$parts
[
'pass'
]
)
,
'site'
);
drush_set_option
(
'db_name'
,
substr
(
urldecode
(
$parts
[
'path'
]
)
,
1
),
'site'
);
drush_set_option
(
'profile'
,
variable_get
(
'install_profile'
,
'default'
),
'site'
);
$has_locale
=
db_result
(
db_query
(
"SELECT status FROM
{
system
}
WHERE type='module' AND name='locale'"
));
...
...
platform/drupal/import_6.inc
View file @
6529e195
...
...
@@ -8,11 +8,11 @@ else {
}
if
(
$parts
=
@
parse_url
(
$db_url
))
{
drush_set_option
(
'db_type'
,
$parts
[
'scheme'
],
'site'
);
drush_set_option
(
'db_user'
,
$parts
[
'user'
],
'site'
);
drush_set_option
(
'db_host'
,
$parts
[
'host'
],
'site'
);
drush_set_option
(
'db_passwd'
,
$parts
[
'pass'
],
'site'
);
drush_set_option
(
'db_name'
,
substr
(
$parts
[
'path'
],
1
),
'site'
);
drush_set_option
(
'db_type'
,
urldecode
(
$parts
[
'scheme'
]
)
,
'site'
);
drush_set_option
(
'db_user'
,
urldecode
(
$parts
[
'user'
]
)
,
'site'
);
drush_set_option
(
'db_host'
,
urldecode
(
$parts
[
'host'
]
)
,
'site'
);
drush_set_option
(
'db_passwd'
,
urldecode
(
$parts
[
'pass'
]
)
,
'site'
);
drush_set_option
(
'db_name'
,
substr
(
urldecode
(
$parts
[
'path'
]
)
,
1
),
'site'
);
drush_set_option
(
'profile'
,
variable_get
(
'install_profile'
,
'default'
),
'site'
);
$language
=
language_default
();
...
...
platform/drupal/import_7.inc
View file @
6529e195
<?php
global
$databases
;
if
(
$db
=
$databases
[
'default'
][
'default'
])
{
drush_set_option
(
'db_type'
,
$db
[
'driver'
],
'site'
);
drush_set_option
(
'db_user'
,
$db
[
'username'
],
'site'
);
drush_set_option
(
'db_host'
,
$db
[
'host'
],
'site'
);
drush_set_option
(
'db_passwd'
,
$db
[
'password'
],
'site'
);
drush_set_option
(
'db_name'
,
$db
[
'database'
],
'site'
);
drush_set_option
(
'db_type'
,
urldecode
(
$db
[
'driver'
]
)
,
'site'
);
drush_set_option
(
'db_user'
,
urldecode
(
$db
[
'username'
]
)
,
'site'
);
drush_set_option
(
'db_host'
,
urldecode
(
$db
[
'host'
]
)
,
'site'
);
drush_set_option
(
'db_passwd'
,
urldecode
(
$db
[
'password'
]
)
,
'site'
);
drush_set_option
(
'db_name'
,
urldecode
(
$db
[
'database'
]
)
,
'site'
);
drush_set_option
(
'profile'
,
variable_get
(
'install_profile'
,
'default'
),
'site'
);
$language
=
language_default
();
...
...
platform/provision_drupal_settings.tpl.php
View file @
6529e195
...
...
@@ -6,7 +6,7 @@
'password'
=>
'<?php print $db_passwd; ?>'
,
'host'
=>
'<?php print $db_host ?>'
,
);
$db_url
=
'<?php print
"$
db_type://
$db_user:$db_passwd@$db_host/
$db_name
"
; ?>'
;
$db_url
=
'<?php print
strtr("%
db_type://
%db_user:%db_passwd@%db_host/%db_name", array('
%
db_type
' => urlencode($db_type), '
%
db_user
' => urlencode($db_name), '
%
db_passwd
' => urlencode($db_passwd), '
%
db_host
' => urlencode($db_host), '
%
db_name
' => urlencode(
$db_name
)))
; ?>'
;
$profile
=
"<?php print
$profile
?>"
;
/**
...
...
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