First commit / commit pertama

This commit is contained in:
Mr.Haruna
2026-06-13 11:24:58 +07:00
commit 522c4f7200
166 changed files with 13326 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
require_once __DIR__ . '/config/app.php';
$host = getenv('DB_HOST') ?: 'localhost';
$port = getenv('DB_PORT') ?: 3306;
$user = getenv('DB_USERNAME') ?: 'root';
$pass = getenv('DB_PASSWORD') ?: '';
$db = getenv('DB_DATABASE') ?: 'webgis_db';
try {
$pdo = new PDO("mysql:host=$host;port=$port;dbname=$db;charset=utf8mb4", $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Read SQL file
$sqlFile = __DIR__ . '/../database/webgis_db.sql';
if (!file_exists($sqlFile)) {
die("SQL file not found at: $sqlFile");
}
$sql = file_get_contents($sqlFile);
// Split into statements and execute
$pdo->exec($sql);
echo "Database imported successfully to $db at $host!";
} catch (PDOException $e) {
echo "Connection failed: " . $e->getMessage() . "\n";
}