Permalink
Browse files

removed hardcoded database name from drupal seed app

  • Loading branch information...
vmmello committed Jan 5, 2019
1 parent 8915a59 commit 4d1ebfed800c55d4329f4c0fbee90186fba0495e
Showing with 6 additions and 6 deletions.
  1. +6 −6 bin/seeds/drupal/restore-vhost.functions
@@ -235,15 +235,15 @@ drupal_update_php_config()
fi

# removing the file_temporary_path before exporting the site
run_mysql -B -D drupal -e "DELETE FROM variable WHERE name = 'file_temporary_path';"
sql_query "DELETE FROM variable WHERE name = 'file_temporary_path';"

else
# if the site is not to be exported, then add a custom temp dir
# to fix a know problem in drupal dealing with tmp files (when multiple
# users share /tmp)

local is_tmp_set
is_tmp_set=$(mysql -B -D drupal -N -e "SELECT * FROM variable WHERE name = 'file_temporary_path'")
is_tmp_set=$(sql_query_result "SELECT * FROM variable WHERE name = 'file_temporary_path'")
local tmp_dir="/tmp/.private/$user_web"
local tmp_sql_str
if [ -n "$is_tmp_set" ]; then
@@ -252,7 +252,7 @@ drupal_update_php_config()
tmp_sql_str="INSERT INTO variable VALUES ( 'file_temporary_path', 's:${#tmp_dir}:\"$tmp_dir\";');"
fi

run_mysql -B -D drupal -e "$tmp_sql_str"
sql_query "$tmp_sql_str"
fi
}

@@ -429,7 +429,7 @@ drupal_update_php_config_8() {
drupal_set_tmp_6_or_7() {
local is_tmp_set=""

is_tmp_set=$(mysql -B -D drupal -N -e "SELECT * FROM variable WHERE name = 'file_temporary_path'")
is_tmp_set=$(sql_query_result "SELECT * FROM variable WHERE name = 'file_temporary_path'")

local tmp_dir="$HOME/.tmp"

@@ -446,7 +446,7 @@ drupal_set_tmp_6_or_7() {
tmp_sql_str="INSERT INTO variable VALUES ( 'file_temporary_path', 's:${#tmp_dir}:\"$tmp_dir\";');"
fi

run_mysql -B -D drupal -e "$tmp_sql_str"
sql_query "$tmp_sql_str"
}

drupal_set_tmp_8() {
@@ -461,7 +461,7 @@ drupal_set_cron_key_8() {
local new_key=`wedp_gen_random_str 43`
local sql_cron_key="UPDATE key_value SET value = 's:${#new_key}:\"$new_key\";' WHERE collection = 'state' AND name = 'system.cron_key';"

run_mysql -B -D drupal -e "$sql_cron_key"
sql_query "$sql_cron_key"
}


0 comments on commit 4d1ebfe

Please sign in to comment.