44 lines
1.8 KiB
PHP
44 lines
1.8 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
|
|
// Files that render "Claude" or "Claude-pattern" badge VISIBLE on public wevia.html
|
|
$w = @file_get_contents("/var/www/html/wevia.html");
|
|
$out["wevia_html"] = [
|
|
"size" => strlen($w),
|
|
"claude_text_count" => substr_count($w, "Claude"),
|
|
"claude_pattern_count" => preg_match_all("/Claude[\s\-]?pattern/i", $w),
|
|
"WEVIA_Claude_pattern" => substr_count($w, "WEVIA Claude-pattern"),
|
|
"Claude_pattern_span" => preg_match_all("/<span[^>]*>Claude[\s\-]?[Pp]attern/i", $w),
|
|
];
|
|
|
|
// Find the exact rendering in wevia.html
|
|
$pos = strpos($w, "Claude-pattern");
|
|
if ($pos === false) $pos = strpos($w, "Claude pattern");
|
|
if ($pos === false) $pos = strpos($w, "WEVIA Claude");
|
|
if ($pos !== false) $out["wevia_context"] = substr($w, max(0, $pos - 200), 500);
|
|
|
|
// Mermaid generator - check output
|
|
$mp = @file_get_contents("/var/www/html/api/ambre-tool-mermaid.php");
|
|
$out["mermaid_tool"] = [
|
|
"size" => strlen($mp ?? ""),
|
|
"exists" => file_exists("/var/www/html/api/ambre-tool-mermaid.php"),
|
|
];
|
|
|
|
// Find V5-claude-pattern source
|
|
$out["claude_pattern_sources"] = trim(@shell_exec("grep -lE 'claude[- ]?pattern|Claude[- ]?[Pp]attern' /var/www/html/wevia.html /var/www/html/*.html /var/www/html/api/*.php 2>/dev/null | head -10"));
|
|
|
|
// Check V5-CLAUDE-PATTERN block in wevia.html
|
|
if (preg_match("/\/\/ === AMBRE-V5-CLAUDE-PATTERN.{0,10000}\/\/ === END AMBRE-V5-CLAUDE-PATTERN/s", $w, $m)) {
|
|
$out["v5_block_size"] = strlen($m[0]);
|
|
// Extract the rendered badges
|
|
if (preg_match_all('/["\']WEVIA[^"\']*Claude[^"\']*pattern[^"\']*["\']/', $m[0], $badges)) {
|
|
$out["v5_badges"] = $badges[0];
|
|
}
|
|
if (preg_match_all('/["\']WEVIA[- ]?pattern["\']/i', $m[0], $badges2)) {
|
|
$out["v5_badges_alt"] = $badges2[0];
|
|
}
|
|
}
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|