Elgg  Version master
opcache.php
Go to the documentation of this file.
1 <?php
6 $opcache_available = function_exists('opcache_get_status');
8 
10  $opcache_status = opcache_get_status(false);
11 }
12 
13 if (!$opcache_available || empty($opcache_status)) {
14  echo '<p>' . elgg_echo('admin:server:opcache:inactive') . '</p>';
15  return;
16 }
17 
18 $array_to_table = function($array) use (&$array_to_table) {
19  $rows = '';
20  foreach ($array as $key => $value) {
21  if (is_array($value)) {
22  $rows .= "<tr><th colspan='2'><b>{$key}</b></th></tr>";
23 
25  continue;
26  }
27 
28  if ($value === true) {
29  $value = 'true';
30  } elseif ($value === false) {
31  $value = 'false';
32  }
33 
34  $rows .= "<tr><td>{$key}</td><td>{$value}</td></tr>";
35  }
36 
37  return $rows;
38 };
39 
40 echo elgg_format_element('table', ['class' => 'elgg-table'], $array_to_table($opcache_status));
if($opcache_available) if(!$opcache_available||empty($opcache_status)) $array_to_table
Definition: opcache.php:18
$rows
Definition: redis.php:25
$opcache_status
Definition: opcache.php:7
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$opcache_available
OPCache info.
Definition: opcache.php:6
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
Definition: item.php:48
$value
Definition: generic.php:51
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:44
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145