= 3) { $subdomain = $parts[0]; } } if ($subdomain === 'www' || $subdomain === '') { define('ENVIRONMENT', 'production'); define('DEBUG', false); } else { define('ENVIRONMENT', 'development'); define('DEBUG', true); } // PHP error reporting if (DEBUG) { error_reporting(E_ALL); ini_set('display_errors', '1'); } else { error_reporting(0); ini_set('display_errors', '0'); } //== BASICS define('__ROOT__', dirname(dirname(__FILE__))); $scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http'; define('__URL__', $scheme . '://' . $host . '/'); //== SITE META — customize these for your project define('SITE_NAME', 'bare-site'); define('SITE_DESCRIPTION', 'A zero-dependency PHP micro-framework for static multi-language sites'); define('SITE_AUTHOR', ''); define('SITE_KEYWORDS', ''); //== API KEYS — optional, leave empty to disable features define('GEO_KEY',''); // ipgeolocation.io — for visitor geo-location define('TELEGRAM_BOT_TOKEN',''); // Telegram bot token — for visitor notifications define('TELEGRAM_CHAT_ID', ''); // Telegram chat ID //== Bot Detection define('BLOCK_THRESHOLD', '5'); define('SUSPICIOUS_THRESHOLD', '3'); define('ALERT_THRESHOLD', '10'); //== SUPPORTED LANGUAGES — add/remove as needed $languages = ['en' => 'English', 'de' => 'Deutsch', 'fr' => 'Française', 'it' => 'Italiano', 'nl' => 'Nederlands', 'es' => 'Español', 'pt' => 'Português']; define('LANGUAGES', $languages); //== DEFINE GLOBAL SLUGS — map URL paths to page templates define('PAGE_00_SLUG','home'); define('PAGE_01_SLUG','about'); define('PAGE_02_SLUG','start'); define('PAGE_03_SLUG',''); define('PAGE_04_SLUG',''); define('PAGE_05_SLUG','not-used'); //== SECURITY CONSTANTS define('BOT_USER_AGENT_PATTERNS', [ '/bot/i', '/crawl/i', '/spider/i', '/scanner/i', '/monitor/i', '/python-requests/i', '/python-urllib/i', '/curl/i', '/wget/i', '/zgrab/i', '/httpx/i', '/go-http-client/i', '/java/i', '/masscan/i', '/aiohttp/i', '/censysinspect/i', '/amazonbot/i', '/dotbot/i', '/360spider/i', '/dnbcrawler/i', '/semrushbot/i', '/ahrefsbot/i', '/yandexbot/i', '/facebookexternalhit/i', '/facebot/i', '/twitterbot/i', '/bingbot/i', '/duckduckbot/i', '/nmap/i', '/nikto/i', '/nessus/i', '/(?:libwww-perl|lwp-request)/i', '/screaming frog/i', '/postman/i' ]); define('BLOCKED_PATHS', [ '/.env', '/.git', '/wp-admin', '/administrator', '/config', '/backup', '/sql', '/database', '/admin', '/cgi-bin', '/wp-login.php', '/readme.html', '/license.txt', '/phpinfo.php', '/pma', '/phpmyadmin', '/install.php', '/shell.php', '/vendor', '/composer.json', '/passwd', '/etc/passwd', '/logs', '/velocity.csv' ]);