<?php declare(strict_types=1); if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit('Direct access denied.'); } class Obfuscator { private static ?array $manifest = null; private static function loadManifest(): array { if (self::$manifest !== null) { return self::$manifest; } $path = PRIVATE_DIR . '/manifest.php'; if (!file_exists($path)) { self::$manifest = []; return self::$manifest; } self::$manifest = require $path; return self::$manifest; } public static function resolveClass(string $obfuscated): string { $manifest = self::loadManifest(); $flipped = array_flip($manifest['css'] ?? []); return $flipped[$obfuscated] ?? $obfuscated; } public static function resolveTable(string $obfuscated): string { $manifest = self::loadManifest(); $flipped = array_flip($manifest['tables'] ?? []); return $flipped[$obfuscated] ?? $obfuscated; } public static function resolveColumn(string $obfuscated): string { $manifest = self::loadManifest(); $flipped = array_flip($manifest['columns'] ?? []); return $flipped[$obfuscated] ?? $obfuscated; } public static function obfuscate(string $type, string $humanName): string { $manifest = self::loadManifest(); return $manifest[$type][$humanName] ?? $humanName; } } 