<?php
// CHANGE THIS to match where your repos folder actually is:
$ROOT = realpath(__DIR__ . "/..");  

$path = $ROOT . "/repos.elegantwork.co.za/";

if (!is_dir($path)) {
    echo json_encode(["debug" => "Dir not found: $path"]);
    exit;
}


$files = glob($path . "*-log.txt");

$result = [];
foreach ($files as $f) {
    $result[] = basename($f);
}

header("Content-Type: application/json");
echo json_encode($result);
