Files
html/api/ambre-oss-wire.php
opus 758b8409a0
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
auto-sync-0405
2026-04-22 04:05:02 +02:00

28 lines
837 B
PHP

<?php
header("Content-Type: application/json");
$path = "/var/www/html/oss-catalog.html";
$c = @file_get_contents($path);
$orig = strlen($c);
if (strpos($c, "dashboards-hub-unified") !== false) {
echo json_encode(["already"=>true]);
exit;
}
// Inject in footer
$old = '<a href="/dashboards-index.html">Dashboards</a>';
$new = '<a href="/dashboards-hub-unified.html">📊 Hub Dashboards</a> · <a href="/dashboards-index.html">Index</a>';
if (strpos($c, $old) !== false) {
$c = str_replace($old, $new, $c);
$backup = "/opt/wevads/vault/oss-catalog.GOLD-" . date("Ymd-His") . "-wave246";
@copy($path, $backup);
$wrote = @file_put_contents($path, $c);
echo json_encode([
"wrote" => $wrote,
"delta" => strlen($c) - $orig,
]);
} else {
echo json_encode(["error"=>"anchor not found"]);
}