24 lines
924 B
PHP
24 lines
924 B
PHP
<?php
|
|
// ambre-opcache-reset.php · AMBRE · force opcache reload after safe-write
|
|
header("Content-Type: application/json");
|
|
$out = ["ok"=>false, "opcache"=>false, "apcu"=>false];
|
|
if (function_exists("opcache_reset")) {
|
|
$out["opcache"] = opcache_reset() ? "reset_ok" : "reset_failed";
|
|
$out["opcache_status"] = function_exists("opcache_get_status") ? (opcache_get_status(false)["opcache_enabled"] ?? null) : null;
|
|
}
|
|
if (function_exists("apcu_clear_cache")) {
|
|
$out["apcu"] = apcu_clear_cache() ? "clear_ok" : "clear_failed";
|
|
}
|
|
// Also touch the fast-path file to bump mtime (backup trigger for older PHP)
|
|
$targets = [
|
|
"/var/www/html/api/wevia-fast-path.php",
|
|
"/var/www/html/api/wevia-autonomous.php",
|
|
];
|
|
$out["touched"] = [];
|
|
foreach ($targets as $t) {
|
|
if (file_exists($t)) { @touch($t); $out["touched"][] = $t; }
|
|
}
|
|
$out["ok"] = true;
|
|
$out["ts"] = date("c");
|
|
echo json_encode($out, JSON_PRETTY_PRINT);
|