Skip to content

Commit

Permalink
very simple invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
gondo committed May 17, 2014
1 parent a978692 commit f737656
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions opcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
require 'data-sample.php';
}

if (isset($_GET['invalidate'])) {
opcache_reset();
header('Location: .');
die;
}

class OpCacheDataModel
{
private $_configuration;
Expand Down Expand Up @@ -437,6 +443,10 @@ private function _arrayPset(&$array, $key, $value)
label {
cursor: pointer;
}

#invalidate {
float: right;
}
</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 @@ -459,6 +469,8 @@ function toggleVisible(head, row) {

<body>
<div id="container">
<a id="invalidate" href="?invalidate" onclick="return confirm('Confirm invalidation');">Invalidate</a>

<h1><?php echo $dataModel->getPageTitle(); ?></h1>

<div class="tabs">
Expand Down

1 comment on commit f737656

@rlerdorf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is a good idea without some sort of authentication. Maybe just a baked in password, or something. If people have this exposed to the world and I blindly merge this, it would be bad.

Please sign in to comment.