.  $GRIMOIRE/FUNCTIONS                                                                                           &&
config_query_string  DRUPAL_INSTALL_PATH                                                                         \
                     "What path do you wish to use for installation (the spell name and version will be added at the end)?"  \
                     "usr/share/www"                                                                             &&

config_query_list  DRUPAL_DATABASE_ENGINE                                                                        \
                   "Which database engine would you like to use?"                                                \
                   mysql                                                                                         \
                   postgresql                                                                                    &&

persistent_add  DRUPAL_INSTALLED                                                                                 &&
if  spell_ok  ${SPELL}
then
  DRUPAL_INSTALLED="y"
else
  DRUPAL_INSTALLED="n"
fi                                                                                                               &&

if  [  "${DRUPAL_INSTALLED}"  ==  "n"  ]
then
  persistent_add  DRUPAL_CREATEDB  DRUPAL_CONFIGURE  MYSQL_PASSWORD                                              &&

  message  "${MESSAGE_COLOR}The MySQL daemon needs to be running to create the database${DEFAULT_COLOR}"         &&
  if  query  "Create the Drupal database?"  n
  then
    DRUPAL_CREATEDB="y"                                                                                          &&
    if  query  "Do you need a password to create a database w/MySQL?"  y
    then
      query_string  MYSQL_PASSWORD  "What is the MySQL password for root (needed to create the database)? If there is no password, just press enter. "  ""
    fi
  else
    DRUPAL_CREATEDB="n"
  fi                                                                                                             &&

  if  query  "Update the Drupal configuration file?"  n
  then
    DRUPAL_CONFIGURE="y"
  else
    DRUPAL_CONFIGURE="n"
  fi                                                                                                             &&

  if  [  "${DRUPAL_CREATEDB}"  ==  "y"  ]  ||  [  "${DRUPAL_CONFIGURE}"  ==  "y"  ];  then
    config_query_string  DRUPAL_DATABASE_NAME                                                                    \
                         "What database name do you wish to use for the database?"                               \
                         "drupal"                                                                                &&

    config_query_string  DRUPAL_DATABASE_USER                                                                    \
                         "What user name do you wish to use for the database?"                                   \
                         "nobody"                                                                                &&

    config_query_string  DRUPAL_DATABASE_HOST                                                                    \
                         "What host name do you wish to use for the database?"                                   \
                         "localhost"                                                                             &&

    config_query_string  DRUPAL_DATABASE_PASSWORD                                                                \
                         "What password do you wish to use for the database?
  Allowed characters include letters, digits, and any of the following:
  -_!#$%^&*()+={}[]|<>;:?,.~
  "                                                                                                              \
                         "password"
  fi
fi
