Merge pull request #2992 from HB9HIL/apcu_default

This commit is contained in:
Fabian Berg
2026-02-23 07:10:48 +01:00
committed by GitHub
4 changed files with 61 additions and 14 deletions

View File

@@ -433,7 +433,7 @@ $config['error_views_path'] = '';
|
*/
$config['cache_path'] = '';
$config['cache_adapter'] = 'file';
$config['cache_adapter'] = 'apcu';
$config['cache_backup'] = 'file';
$config['cache_key_prefix'] = '';

View File

@@ -109,10 +109,10 @@ class Debug extends CI_Controller
$cache_info = $this->Debug_model->get_cache_info();
$data['cache_available_adapters'] = $cache_info['adapters'];
$data['cache_path'] = $cache_info['config']['cache_path'] ?: 'application/cache';
$data['cache_adapter'] = ucfirst($cache_info['config']['cache_adapter'] ?? 'file');
$data['cache_backup'] = ucfirst($cache_info['config']['cache_backup'] ?? 'file');
$data['cache_adapter'] = strtolower($cache_info['config']['cache_adapter'] ?? 'file');
$data['cache_backup'] = strtolower($cache_info['config']['cache_backup'] ?? 'file');
$data['cache_key_prefix'] = $cache_info['config']['cache_key_prefix'] ?: __("(empty)");
$data['active_adapter'] = ucfirst($cache_info['active']['adapter'] ?? ($cache_info['config']['cache_adapter'] ?? 'file'));
$data['active_adapter'] = strtolower($cache_info['active']['adapter'] ?? ($cache_info['config']['cache_adapter'] ?? 'file'));
$data['using_backup'] = !empty($cache_info['active']['using_backup']);
$data['details_cache_size'] = $cache_info['details']['size'] ?? '0 B';
$data['details_cache_keys_count'] = $cache_info['details']['keys_count'] ?? 0;

View File

@@ -315,6 +315,45 @@
<?php } ?>
</td>
</tr>
<?php if ($cache_adapter == 'apcu' || $cache_backup == 'apcu') { ?>
<tr>
<td>php-apcu</td>
<td>
<?php if (in_array('apcu', get_loaded_extensions())) { ?>
<span class="badge text-bg-success"><?= __("Installed"); ?></span>
<?php } else { ?>
<span class="badge text-bg-danger"><?= __("Not Installed"); ?></span>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php if ($cache_adapter == 'redis' || $cache_backup == 'redis') { ?>
<tr>
<td>php-redis</td>
<td>
<?php if (in_array('redis', get_loaded_extensions())) { ?>
<span class="badge text-bg-success"><?= __("Installed"); ?></span>
<?php } else { ?>
<span class="badge text-bg-danger"><?= __("Not Installed"); ?></span>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php if ($cache_adapter == 'memcached' || $cache_backup == 'memcached') { ?>
<tr>
<td>php-memcached</td>
<td>
<?php if (in_array('memcached', get_loaded_extensions())) { ?>
<span class="badge text-bg-success"><?= __("Installed"); ?></span>
<?php } else { ?>
<span class="badge text-bg-danger"><?= __("Not Installed"); ?></span>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
</div>
<div class="col">
@@ -433,6 +472,8 @@
<span class="badge text-bg-primary"><?php echo $cache_backup; ?></span>
<?php if ($cache_backup == $active_adapter) { ?>
<span class="badge text-bg-success"><?= __("Active"); ?></span>
<?php } else if ($active_adapter == 'dummy') { ?>
<span class="badge text-bg-danger"><?= __("Failed"); ?></span>
<?php } ?>
</td>
</tr>
@@ -445,15 +486,6 @@
<td><code><?php echo $cache_key_prefix; ?></code></td>
</tr>
</table>
<?php if ($using_backup) { ?>
<div class="alert alert-danger mt-2 mb-0" role="alert">
<?= __("Cache is currently using the backup adapter because the primary is unavailable."); ?>
</div>
<?php } else { ?>
<div class="alert alert-success mt-2 mb-0" role="alert">
<?= __("Cache is working properly. Everything okay!"); ?>
</div>
<?php } ?>
</div>
<div class="col-md-6">
<p><u><?= __("Cache Details"); ?></u></p>
@@ -472,6 +504,21 @@
</tr>
</table>
</div>
<div class="ms-2 me-2">
<?php if (!$using_backup) { ?>
<div class="alert alert-success mt-2 mb-0" role="alert">
<?= __("Cache is working properly. Everything okay!"); ?>
</div>
<?php } else if ($active_adapter !== 'dummy') { ?>
<div class="alert alert-danger mt-2 mb-0" role="alert">
<?= __("Cache is currently using the backup adapter because the primary is unavailable. Check your file permissions, php-extensions and/or if you are using redis/memcached your network connection to the services."); ?>
</div>
<?php } else { ?>
<div class="alert alert-danger mt-2 mb-0" role="alert">
<?= __("Cache does not work! Currently the system is using a %s adapter. Check your file permissions, php-extensions and/or if you are using redis/memcached your network connection to the services. You can continue using Wavelog, but no values will be cached (which is bad).", "'dummy'"); ?>
</div>
<?php } ?>
</div>
</div>
<div class="border-top pt-3 mt-3">
<div class="row">