Files
html/api/ambre-logo-finder.php
2026-04-21 15:40:02 +02:00

31 lines
1.1 KiB
PHP

<?php
header("Content-Type: application/json");
$out = [];
$targets = [
"/var/www/html/solution",
"/var/www/html/solutions",
"/var/www/html/assets",
"/var/www/html/wevia-ia",
"/var/www/html/img",
"/var/www/html/images",
"/var/www/html/static",
"/var/www/html",
];
foreach ($targets as $t) {
if (!is_dir($t)) { $out[$t] = "MISSING"; continue; }
$logos = @glob("$t/*logo*wevia*") ?: [];
$logos = array_merge($logos, @glob("$t/*wevia*logo*") ?: []);
$logos = array_merge($logos, @glob("$t/logo-wevia*") ?: []);
$logos = array_merge($logos, @glob("$t/wevia-logo*") ?: []);
// Also direct files
foreach (["logo.svg","logo.png","wevia.svg","wevia.png","logo-wevia.svg","logo-wevia.png"] as $name) {
if (file_exists("$t/$name")) $logos[] = "$t/$name";
}
if ($logos) $out[$t] = array_map(function($p){return ["path"=>$p,"size"=>@filesize($p)];}, array_unique($logos));
}
// Also check /solution* root-level
$root = @shell_exec("ls -d /solution* /var/www/html/solution* 2>/dev/null");
if ($root) $out["solution_roots"] = trim($root);
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);