<?php
$ROOT = realpath(__DIR__ . "/..");  

$path = $ROOT . "/repos.elegantwork.co.za/";

if (!isset($_GET['file'])) {
    exit("No file selected.");
}

$file = basename($_GET['file']); // Security — prevents path traversal
$full = $path . $file;

if (!file_exists($full)) {
    exit("File not found.");
}

echo "<pre style='padding:15px; white-space: pre-wrap; font-size:14px;'>";
echo htmlspecialchars(file_get_contents($full));
echo "</pre>";
