$pluginDir . '/src/']; if ($shimRoot !== null) { $map['Sarcio\\Shim\\'] = $shimRoot; } foreach ($map as $prefix => $base) { if (strncmp($class, $prefix, strlen($prefix)) !== 0) { continue; } $file = $base . str_replace('\\', '/', substr($class, strlen($prefix))) . '.php'; if (is_file($file)) { require_once $file; } return; } }); } /** * Whether the PHP shim is present. Server-side patching is inert without it; * the UI side (reporter + DOM patches) has no PHP dependency at all and keeps * working either way. */ public static function shimAvailable(): bool { return class_exists(\Sarcio\Shim\Shim::class); } }