Adjust PHP script 'Files/opcache_clear.php'.

This commit is contained in:
2025-07-18 12:04:29 +02:00
parent d9388f38d1
commit bca10b8c09
2 changed files with 103 additions and 4 deletions

View File

@@ -43,6 +43,8 @@ if (isset($_GET['logout'])) {
h1 { font-size: 1.4em; }
input[type="text"], input[type="password"] { width: 100%; padding: 0.5em; margin-top: 0.3em; }
input[type="submit"] { padding: 0.6em 1.2em; margin-top: 1em; }
.button-block { margin-bottom: 1em; }
.separator { border-top: 1px solid #ccc; margin: 1.5em 0; }
.status { margin-top: 1em; padding: 1em; background: #eef; border-left: 4px solid #99f; }
.error { color: red; }
.logout { float: right; }
@@ -63,10 +65,6 @@ if (isset($_GET['logout'])) {
<a href="?logout=1">Abmelden</a>
</div>
<h1>OPCache-Verwaltung</h1>
<form method="post">
<input type="submit" name="clear" value="OPCache jetzt leeren">
</form>
<div class="status">
<?php
if (function_exists('opcache_get_status') && function_exists('opcache_reset')) {
@@ -75,7 +73,14 @@ if (isset($_GET['logout'])) {
echo " OPCache ist installiert, aber aktuell nicht aktiviert.";
} else {
echo "✅ OPCache ist aktiviert.<br>";
// Zeige Button nur wenn aktiv
echo '<form method="post" class="button-block">';
echo '<input type="submit" name="clear" value="OPCache jetzt leeren">';
echo '</form>';
if (isset($_POST['clear'])) {
echo '<div class="separator"></div>';
if (opcache_reset()) {
echo "✅ OPCache wurde erfolgreich geleert.";
} else {