This repository was archived by the owner on Nov 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,12 @@ function toggleVisible(head, row) {
200
200
<label for="tab-status">Status</label>
201
201
<div class="content">
202
202
<table>
203
- <?php echo $ view ->getStatusDataRows (); ?>
203
+ <?php foreach ($ view ->getStatus () as $ row ): ?>
204
+ <tr>
205
+ <th><?php echo $ row ['key ' ] ?> </th>
206
+ <td><?php echo $ row ['value ' ] ?> </td>
207
+ </tr>
208
+ <?php endforeach ?>
204
209
</table>
205
210
</div>
206
211
</div>
Original file line number Diff line number Diff line change @@ -23,9 +23,8 @@ public function pageTitle()
23
23
return 'PHP ' . PHP_VERSION . " with OpCache {$ this ->configuration ['version ' ]['version ' ]}" ;
24
24
}
25
25
26
- public function getStatusDataRows ()
26
+ public function getStatus ()
27
27
{
28
- $ rows = array ();
29
28
foreach ($ this ->status as $ key => $ value ) {
30
29
if ($ key === 'scripts ' ) {
31
30
continue ;
@@ -35,8 +34,7 @@ public function getStatusDataRows()
35
34
foreach ($ value as $ k => $ v ) {
36
35
if ($ v === false ) {
37
36
$ value = 'false ' ;
38
- }
39
- if ($ v === true ) {
37
+ } elseif ($ v === true ) {
40
38
$ value = 'true ' ;
41
39
}
42
40
if ($ k === 'used_memory ' || $ k === 'free_memory ' || $ k === 'wasted_memory ' ) {
@@ -57,21 +55,17 @@ public function getStatusDataRows()
57
55
if (THOUSAND_SEPARATOR === true && is_int ($ v )) {
58
56
$ value = number_format ($ v );
59
57
}
60
-
61
- $ rows [] = "<tr><th> $ k</th><td> $ value</td></tr> \n" ;
58
+ yield ["key " => $ k , "value " => $ value ];
62
59
}
63
60
} else {
64
61
if ($ value === false ) {
65
62
$ value = 'false ' ;
66
- }
67
- if ($ value === true ) {
63
+ } elseif ($ value === true ) {
68
64
$ value = 'true ' ;
69
65
}
70
- $ rows [] = " <tr><th> $ key</th><td> $ value</td></tr> \n" ;
66
+ yield [ " key " => $ key, " value " => $ value] ;
71
67
}
72
68
}
73
-
74
- return implode ("\n" , $ rows );
75
69
}
76
70
77
71
public function getSettings ()
You can’t perform that action at this time.
0 commit comments