You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
559 B

  1. #!/bin/bash
  2. . lib/common
  3. set -e
  4. PASSWORD="$(relation-get password)"
  5. USER="$(relation-get user)"
  6. DBNAME="$(relation-get dbname)"
  7. cfg_dir=$(cfg_dir_init) || exit 1
  8. cd "$cfg_dir" || exit 1
  9. cat <<EOF >> config.php
  10. const DB_CONNECTION_STRING = 'pgsql:host=$TARGET_SERVICE_NAME;dbname=$DBNAME;port=5432';
  11. const DB_DRIVER = 'pdo_pgsql';
  12. const DB_NAME = '$DBNAME';
  13. const DB_HOST = '$TARGET_SERVICE_NAME';
  14. const DB_PORT = '5432';
  15. const DB_USER= '$USER';
  16. const DB_PASSWORD = '$PASSWORD';
  17. const TABLENAME_PREFIX = 'fd_';
  18. const MIGRATION_TABLE = 'migration';
  19. EOF