summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2009-05-19 21:45:22 (GMT)
committeranarcat2009-05-19 21:45:22 (GMT)
commit02ad961681d4f93c7eaffed59d087c280dacaa66 (patch)
treee1dd51398014f36a2849105a5c5da89adb54430e
parentcfe2a498485532802ac1dee601c89c79be0614a0 (diff)
style: clarify control flow in grant guessing routine6.x-0.2-rc1
-rw-r--r--db_server/provision_mysql.drush.inc12
1 files changed, 6 insertions, 6 deletions
diff --git a/db_server/provision_mysql.drush.inc b/db_server/provision_mysql.drush.inc
index ba1d883..1a4ade4 100644
--- a/db_server/provision_mysql.drush.inc
+++ b/db_server/provision_mysql.drush.inc
@@ -229,13 +229,13 @@ function _provision_mysql_suggest_db_name($url) {
function _provision_mysql_grant_host($db_host, $web_ip, $web_host) {
// The database hostname is localhost, not defined or on the same ip/host as the webserver.
if (in_array($db_host, array('127.0.0.1', 'localhost', '', $web_ip, $web_host))) {
- return 'localhost';
+ $grant = 'localhost';
}
-
// if we have the web ip, use that first.
- if ($web_ip) {
- return $web_ip;
+ elseif ($web_ip) {
+ $grant = $web_ip;
+ } else {
+ $grant = $web_host;
}
-
- return $web_host;
+ return $grant;
}