new configs for deployment

This commit is contained in:
Araya's Project
2026-06-11 00:12:43 +07:00
parent bc415cd947
commit 5b316b2ef6
7 changed files with 25 additions and 101 deletions
+7 -15
View File
@@ -1,7 +1,5 @@
<?php
// FILE INI HANYA UNTUK INISIALISASI DATABASE
// HAPUS SETELAH DIPAKAI!
// HAPUS FILE INI SETELAH DIPAKAI!
$host = getenv('DB_HOST') ?: 'localhost';
$user = getenv('DB_USER') ?: 'root';
$pass = getenv('DB_PASS') ?: '';
@@ -12,8 +10,6 @@ if ($conn->connect_error) {
}
$sqls = file_get_contents(__DIR__ . '/database/init.sql');
// Pisah per statement
$statements = array_filter(array_map('trim', explode(';', $sqls)));
$success = 0;
@@ -29,16 +25,12 @@ foreach ($statements as $sql) {
}
echo "<h2>DB Init Result</h2>";
echo "<p style='color:green'>✅ $success statements executed successfully.</p>";
echo "<p style='color:green'>✅ $success statements OK</p>";
if (!empty($errors)) {
echo "<h3 style='color:red'>Errors (" . count($errors) . "):</h3>";
foreach ($errors as $e) {
echo "<pre style='background:#fee;padding:8px'>$e</pre>";
}
echo "<h3 style='color:orange'>Errors (" . count($errors) . "):</h3>";
foreach ($errors as $e) echo "<pre style='background:#fee;padding:8px'>$e</pre>";
} else {
echo "<p style='color:green'>✅ All done! Semua database berhasil dibuat.</p>";
echo "<p style='color:red'><b>⚠️ HAPUS FILE INI SEKARANG dari repo!</b></p>";
echo "<p style='color:green'><b>✅ Semua database berhasil dibuat!</b></p>";
echo "<p style='color:red'><b>⚠️ Sekarang hapus file ini dari repo!</b></p>";
}
$conn->close();
$conn->close();