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) {
200200 <label for="tab-status">Status</label>
201201 <div class="content">
202202 <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 ?>
204209 </table>
205210 </div>
206211 </div>
Original file line number Diff line number Diff line change @@ -23,9 +23,8 @@ public function pageTitle()
2323 return 'PHP ' . PHP_VERSION . " with OpCache {$ this ->configuration ['version ' ]['version ' ]}" ;
2424 }
2525
26- public function getStatusDataRows ()
26+ public function getStatus ()
2727 {
28- $ rows = array ();
2928 foreach ($ this ->status as $ key => $ value ) {
3029 if ($ key === 'scripts ' ) {
3130 continue ;
@@ -35,8 +34,7 @@ public function getStatusDataRows()
3534 foreach ($ value as $ k => $ v ) {
3635 if ($ v === false ) {
3736 $ value = 'false ' ;
38- }
39- if ($ v === true ) {
37+ } elseif ($ v === true ) {
4038 $ value = 'true ' ;
4139 }
4240 if ($ k === 'used_memory ' || $ k === 'free_memory ' || $ k === 'wasted_memory ' ) {
@@ -57,21 +55,17 @@ public function getStatusDataRows()
5755 if (THOUSAND_SEPARATOR === true && is_int ($ v )) {
5856 $ value = number_format ($ v );
5957 }
60-
61- $ rows [] = "<tr><th> $ k</th><td> $ value</td></tr> \n" ;
58+ yield ["key " => $ k , "value " => $ value ];
6259 }
6360 } else {
6461 if ($ value === false ) {
6562 $ value = 'false ' ;
66- }
67- if ($ value === true ) {
63+ } elseif ($ value === true ) {
6864 $ value = 'true ' ;
6965 }
70- $ rows [] = " <tr><th> $ key</th><td> $ value</td></tr> \n" ;
66+ yield [ " key " => $ key, " value " => $ value] ;
7167 }
7268 }
73-
74- return implode ("\n" , $ rows );
7569 }
7670
7771 public function getSettings ()
You can’t perform that action at this time.
0 commit comments