@@ -34,6 +34,10 @@ function __construct($search = null) { parent::__construct('user', $search); }
34
34
$ realpathCacheTotal = machine_size (ini_get ('realpath_cache_size ' ));
35
35
}
36
36
37
+ function is_action ($ action ) {
38
+ return isset ( $ _GET ['action ' ] ) && $ _GET ['action ' ] == $ action ;
39
+ }
40
+
37
41
function percentage ( $ a , $ b ) {
38
42
return ( $ a / $ b ) * 100 ;
39
43
}
@@ -188,12 +192,12 @@ function sort_list(&$list) {
188
192
/* OPcache */
189
193
/********************************/
190
194
if (ENABLE_OPCACHE ) {
191
- if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' op_restart ' ) {
195
+ if ( is_action ( ' op_restart ') ) {
192
196
opcache_reset ();
193
197
redirect ('? ' );
194
198
}
195
199
196
- if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' op_delete ' ) {
200
+ if ( is_action ( ' op_delete ') ) {
197
201
$ selector = get_selector ();
198
202
199
203
foreach ( $ opcache ['scripts ' ] as $ key => $ value ) {
@@ -209,12 +213,12 @@ function sort_list(&$list) {
209
213
/* APC */
210
214
/********************************/
211
215
if (ENABLE_APC ) {
212
- if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' apcu_restart ' ) {
216
+ if ( is_action ( ' apcu_restart ') ) {
213
217
apcu_delete ( new ApcuIterator ('#.*# ' ) );
214
218
redirect ('? ' );
215
219
}
216
220
217
- if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' apcu_delete ' ) {
221
+ if ( is_action ( ' apcu_delete ') ) {
218
222
apcu_delete ( new ApcuIterator (get_selector ()) );
219
223
redirect ( '?action=apcu_select&selector= ' . $ _GET ['selector ' ] );
220
224
}
@@ -224,12 +228,12 @@ function sort_list(&$list) {
224
228
/* realpath */
225
229
/********************************/
226
230
if (ENABLE_REALPATH ) {
227
- if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' realpath_clear ' ) {
231
+ if ( is_action ( ' realpath_clear ') ) {
228
232
clearstatcache (true );
229
233
redirect ('?action=realpath_show#realpath ' );
230
234
}
231
235
232
- if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' realpath_delete ' ) {
236
+ if ( is_action ( ' realpath_delete ') ) {
233
237
$ selector = get_selector ();
234
238
235
239
foreach ( $ realpath as $ item ) {
@@ -318,7 +322,7 @@ function sort_list(&$list) {
318
322
</label>
319
323
</form>
320
324
</div>
321
- <?php if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' op_select ' ): ?>
325
+ <?php if ( is_action ( ' op_select ') ): ?>
322
326
<div>
323
327
<h3>Keys matching <?= htmlentities ('" ' .$ _GET ['selector ' ].'" ' )?> </h3>
324
328
<table>
@@ -376,13 +380,13 @@ function sort_list(&$list) {
376
380
<label><input type="checkbox" name="apcu_show_expired" <?= isset ($ _GET ['apcu_show_expired ' ])?'checked="checked" ' :'' ?> />Show expired</label>
377
381
</form>
378
382
</div>
379
- <?php if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' apcu_view ' ): ?>
383
+ <?php if ( is_action ( ' apcu_view ') ): ?>
380
384
<div>
381
385
<h3>Value for <?= htmlentities ('" ' .$ _GET ['selector ' ].'" ' )?> </h3>
382
386
<pre><?= htmlentities (var_export (apcu_fetch (urldecode ($ _GET ['selector ' ])), true )); ?> </pre>
383
387
</div>
384
388
<?php endif ; ?>
385
- <?php if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' apcu_select ' ): ?>
389
+ <?php if ( is_action ( ' apcu_select ') ): ?>
386
390
<div>
387
391
<h3>Keys matching <?= htmlentities ('" ' .$ _GET ['selector ' ].'" ' )?> </h3>
388
392
<table>
@@ -444,7 +448,7 @@ function sort_list(&$list) {
444
448
</form>
445
449
</div>
446
450
447
- <?php if ( isset ( $ _GET [ ' action ' ] ) && $ _GET [ ' action ' ] == ' realpath_select ' ): ?>
451
+ <?php if ( is_action ( ' realpath_select ') ): ?>
448
452
<div>
449
453
<table>
450
454
<thead>
0 commit comments