|
6 | 6 | $AUTOCONFIG['dbtype'] = 'sqlite'; |
7 | 7 | $AUTOCONFIG['dbname'] = getenv('SQLITE_DATABASE'); |
8 | 8 | $autoconfig_enabled = true; |
| 9 | +} elseif (getenv('MYSQL_DATABASE_FILE') && getenv('MYSQL_USER_FILE') && getenv('MYSQL_PASSWORD_FILE') && getenv('MYSQL_HOST')) { |
| 10 | + $AUTOCONFIG['dbtype'] = 'mysql'; |
| 11 | + $AUTOCONFIG['dbname'] = trim(file_get_contents(getenv('MYSQL_DATABASE_FILE'))); |
| 12 | + $AUTOCONFIG['dbuser'] = trim(file_get_contents(getenv('MYSQL_USER_FILE'))); |
| 13 | + $AUTOCONFIG['dbpass'] = trim(file_get_contents(getenv('MYSQL_PASSWORD_FILE'))); |
| 14 | + $AUTOCONFIG['dbhost'] = getenv('MYSQL_HOST'); |
| 15 | + $autoconfig_enabled = true; |
9 | 16 | } elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) { |
10 | 17 | $AUTOCONFIG['dbtype'] = 'mysql'; |
11 | 18 | $AUTOCONFIG['dbname'] = getenv('MYSQL_DATABASE'); |
12 | 19 | $AUTOCONFIG['dbuser'] = getenv('MYSQL_USER'); |
13 | 20 | $AUTOCONFIG['dbpass'] = getenv('MYSQL_PASSWORD'); |
14 | 21 | $AUTOCONFIG['dbhost'] = getenv('MYSQL_HOST'); |
15 | 22 | $autoconfig_enabled = true; |
| 23 | +} elseif (getenv('POSTGRES_DB_FILE') && getenv('POSTGRES_USER_FILE') && getenv('POSTGRES_PASSWORD_FILE') && getenv('POSTGRES_HOST')) { |
| 24 | + $AUTOCONFIG['dbtype'] = 'pgsql'; |
| 25 | + $AUTOCONFIG['dbname'] = trim(file_get_contents(getenv('POSTGRES_DB_FILE'))); |
| 26 | + $AUTOCONFIG['dbuser'] = trim(file_get_contents(getenv('POSTGRES_USER_FILE'))); |
| 27 | + $AUTOCONFIG['dbpass'] = trim(file_get_contents(getenv('POSTGRES_PASSWORD_FILE'))); |
| 28 | + $AUTOCONFIG['dbhost'] = getenv('POSTGRES_HOST'); |
| 29 | + $autoconfig_enabled = true; |
16 | 30 | } elseif (getenv('POSTGRES_DB') && getenv('POSTGRES_USER') && getenv('POSTGRES_PASSWORD') && getenv('POSTGRES_HOST')) { |
17 | 31 | $AUTOCONFIG['dbtype'] = 'pgsql'; |
18 | 32 | $AUTOCONFIG['dbname'] = getenv('POSTGRES_DB'); |
|
0 commit comments