<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

// START SESSION
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// AUTO BASE URL
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || ($_SERVER['SERVER_PORT'] ?? '') == 443) ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'] ?? '';

// ADD FOLDER NAME HERE
define('BASE_URL', $protocol . $host . '/digital_panchayat/');

// ROOT PATH
define('ROOT_PATH', $_SERVER['DOCUMENT_ROOT'] . '/digital_panchayat/');

// HELPER FUNCTION
function asset($path){
    return BASE_URL . ltrim($path, '/');
}

// SECURITY
error_reporting(0);
