added deployment file
This commit is contained in:
1 parent
061d5fd8a4
commit
125eab3cd4
14 files changed
+704
-1
No files matched your search
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// Docker-only replacement for includes/conn.php; local/server config is untouched.
|
||||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
||||
foreach (['MYSQL_HOST', 'MYSQL_DATABASE', 'MYSQL_USER', 'MYSQL_PASSWORD'] as $key) {
|
||||
if (getenv($key) === false || getenv($key) === '') {
|
||||
throw new RuntimeException('Missing database environment variable: ' . $key);
|
||||
}
|
||||
}
|
||||
$conn = new mysqli(
|
||||
getenv('MYSQL_HOST'),
|
||||
getenv('MYSQL_USER'),
|
||||
getenv('MYSQL_PASSWORD'),
|
||||
getenv('MYSQL_DATABASE'),
|
||||
(int) (getenv('MYSQL_PORT') ?: 3306)
|
||||
);
|
||||
$conn->set_charset('utf8mb4');
|
||||
Reference in new issue
Block a user