Elgg  Version 6.1
performance.php
Go to the documentation of this file.
1 <?php
6 $tabs = [];
7 
8 $tabs[] = [
9  'text' => elgg_echo('admin:performance:label:generic'),
10  'content' => elgg_view('admin/performance/generic'),
11  'selected' => true,
12 ];
13 
14 // opcache
15 if (function_exists('opcache_get_status') && opcache_get_status(false)) {
16  $tabs[] = [
17  'text' => elgg_echo('admin:server:label:opcache'),
18  'content' => elgg_view('admin/server/opcache'),
19  ];
20 }
21 
22 // memcache
23 $memcache_servers = elgg_get_config('memcache_servers');
24 if (elgg_get_config('memcache') && !empty($memcache_servers) && \Elgg\Cache\CompositeCache::isMemcacheAvailable()) {
25  $tabs[] = [
26  'text' => elgg_echo('admin:server:label:memcache'),
27  'content' => elgg_view('admin/server/memcache'),
28  ];
29 }
30 
31 // redis
32 $redis_servers = elgg_get_config('redis_servers');
33 if (elgg_get_config('redis') && !empty($redis_servers) && \Elgg\Cache\CompositeCache::isRedisAvailable()) {
34  $tabs[] = [
35  'text' => elgg_echo('admin:server:label:redis'),
36  'content' => elgg_view('admin/server/redis'),
37  ];
38 }
39 
40 echo elgg_view('page/components/tabs', [
41  'tabs' => $tabs,
42 ]);
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$tabs
Show performance suggestions / warnings.
Definition: performance.php:6
if(elgg_get_config('memcache')&&!empty($memcache_servers)&&\Elgg\Cache\CompositeCache::isMemcacheAvailable()) $redis_servers
Definition: performance.php:32
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
if(function_exists('opcache_get_status')&&opcache_get_status(false)) $memcache_servers
Definition: performance.php:23