18 lines
783 B
PHP
18 lines
783 B
PHP
<?php
|
|
header('Content-Type: text/plain; charset=utf-8');
|
|
header('Cache-Control: no-store');
|
|
try {
|
|
require '/var/www/html/includes/conn.php';
|
|
// A database connection alone is insufficient: the initial import and
|
|
// migrations must also be present before this instance is ready for users.
|
|
foreach (['in_daper', 'in_soal', 'in_jawab', 'rec_admin', 'rec_exam_attempt', 'rec_exam_event', 'rec_candidate_login_guard'] as $table) {
|
|
$conn->query("SELECT 1 FROM `$table` LIMIT 0");
|
|
}
|
|
$conn->query('SELECT email, nama_de, nama_be, idkar, password_hash FROM rec_admin LIMIT 0');
|
|
echo "ok\n";
|
|
} catch (Throwable $error) {
|
|
http_response_code(503);
|
|
// Never expose connection details, credentials, or schema errors over HTTP.
|
|
echo "not ready\n";
|
|
}
|