<?php
// Defines all configuration for the app.
// Generated by Gemini.

// Determine the base URL dynamically
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'];
$script_name = $_SERVER['SCRIPT_NAME'];

// If the script is in a subdirectory, include it in the base URL
$path_parts = pathinfo($script_name);
$directory = $path_parts['dirname'];

// If the directory is the root, don't add a trailing slash
if ($directory === '/') {
    $directory = '';
}

// Construct the base URL, ensuring no double slashes if $directory is empty
$base_url = rtrim($protocol . $host . $directory, '/') . '/';

define('BASE_URL', $base_url);


// Database credentials
// Generated by setup_mariadb_project.sh — edit as needed.
define('DB_HOST', '127.0.0.1');
define('DB_NAME', 'app_36782');
define('DB_USER', 'app_36782');
define('DB_PASS', '20e376d2-5a05-4dbf-b7c6-b0ad2ea996d6');
