
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php
declare(strict_types=1);

$configPath = __DIR__ . '/config.php';
if (!file_exists($configPath)) {
  http_response_code(500);
  echo "Missing app/config.php. Copy app/config.sample.php to app/config.php and configure.";
  exit;
}
$config = require $configPath;

session_name($config['session_name'] ?? 'leadcrm_session');
session_start();

require __DIR__ . '/db.php';
require __DIR__ . '/helpers.php';
require __DIR__ . '/i18n.php';
require __DIR__ . '/auth.php';
require __DIR__ . '/rbac.php';

$pdo = db($config);

$lang = current_lang();
set_lang($lang); // ensures stored in session

