<?php
declare(strict_types=1);

/**
 * config.php — TEST environment
 * Updated: 2026-07-22
 *
 * Works both when test_erp is opened as:
 * - https://test.jewellersbd.com/
 * - https://rs2026.thefirstserver.com/test_erp/
 */

$scriptName = str_replace('\\', '/', (string)($_SERVER['SCRIPT_NAME'] ?? ''));
$basePath = (strpos($scriptName, '/test_erp/') !== false
    || substr($scriptName, -9) === '/test_erp') ? '/test_erp' : '';

return [
    'debug' => true,
    'env'   => 'test',

    'base_path'    => $basePath,
    'default_home' => $basePath . '/ui/cash_dashboard.html',

    'role_home' => [
        'admin' => $basePath . '/ui/cash_dashboard.html',
        'user'  => $basePath . '/ui/cash_dashboard.html',
    ],
];
