Files
dbois/app/Config/App.php
T
2026-01-09 11:41:28 +01:00

88 lines
1.6 KiB
PHP

<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class App extends BaseConfig
{
/**
* Base Site URL
*/
public string $baseURL = '';
/**
* Allowed Hostnames in the Site URL other than the hostname in the baseURL.
*
* @var list<string>
*/
public array $allowedHostnames = [];
/**
* Index File
*/
public string $indexPage = '';
/**
* URI Protocol
*/
public string $uriProtocol = 'REQUEST_URI';
/**
* Default Locale
*/
public string $defaultLocale = 'nl';
/**
* Negotiate Locale
*/
public bool $negotiateLocale = false;
/**
* Supported Locales
*
* @var list<string>
*/
public array $supportedLocales = ['nl', 'en'];
/**
* Application Timezone
*/
public string $appTimezone = 'Europe/Amsterdam';
/**
* Default Character Set
*/
public string $charset = 'UTF-8';
/**
* Force Global Secure Requests
*/
public bool $forceGlobalSecureRequests = false;
/**
* Reverse Proxy IPs
*
* @var array<string, string>
*/
public array $proxyIPs = [];
/**
* Content Security Policy
*/
public bool $CSPEnabled = false;
public function __construct()
{
parent::__construct();
// Set baseURL from environment
$this->baseURL = $_ENV['APP_URL'] ?? 'http://localhost';
// Force HTTPS in production
if (($_ENV['ENVIRONMENT'] ?? 'development') === 'production') {
$this->forceGlobalSecureRequests = true;
}
}
}