Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear cache button #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions opcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,18 @@ private function _arrayPset(&$array, $key, $value)
return $array;
}

public function clearCache() {
opcache_reset();
}

}

$dataModel = new OpCacheDataModel();

if (isset($_GET['clear']) && $_GET['clear'] == 1) {
$dataModel->clearCache();
header('Location: ' . $_SERVER['PHP_SELF']);
}
?>
<!DOCTYPE html>
<meta charset="utf-8">
Expand Down Expand Up @@ -457,6 +466,12 @@ private function _arrayPset(&$array, $key, $value)
label {
cursor: pointer;
}

.actions {
margin: 20px 0;
padding: 10px;
border: 1px solid #cacaca;
}
</style>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.0.1/d3.v3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
Expand All @@ -481,6 +496,10 @@ function toggleVisible(head, row) {
<div id="container">
<h1><?php echo $dataModel->getPageTitle(); ?></h1>

<div class="actions">
<a href="?clear=1">Clear cache</a>
</div>

<div class="tabs">

<div class="tab">
Expand Down