-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathconfig.dist.php
More file actions
130 lines (125 loc) · 6.48 KB
/
Copy pathconfig.dist.php
File metadata and controls
130 lines (125 loc) · 6.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
/**
* This file is part of the phpCacheAdmin.
* Copyright (c) Róbert Kelčák (https://kelcak.com/)
*/
declare(strict_types=1);
/*
* Do not edit this file but copy it to config.php.
*/
return [
/**
* The order of the items also changes the position of the
* sidebar links, the first item is also the default dashboard.
*
* You can comment out (or delete) any dashboard.
*/
'dashboards' => [
RobiNN\Pca\Dashboards\Server\ServerDashboard::class,
RobiNN\Pca\Dashboards\Redis\RedisDashboard::class,
RobiNN\Pca\Dashboards\Memcached\MemcachedDashboard::class,
RobiNN\Pca\Dashboards\OPCache\OPCacheDashboard::class,
RobiNN\Pca\Dashboards\APCu\APCuDashboard::class,
RobiNN\Pca\Dashboards\Realpath\RealpathDashboard::class,
],
'redis' => [
[
'name' => 'Localhost', // The server name (optional).
'host' => '127.0.0.1', // Optional when a path or nodes is specified.
/*'nodes' => [
// List of cluster nodes.
'127.0.0.1:7000',
'127.0.0.1:7001',
'127.0.0.1:7002',
],*/
'port' => 6379, // Optional when the default port is used.
//'scheme' => 'tls', // Connection scheme (optional).
/*'ssl' => [
// SSL options for TLS https://www.php.net/manual/en/context.ssl.php - requires Redis >= 6.0 (optional).
'cafile' => 'private.pem',
'verify_peer' => true,
],*/
//'database' => 0, // Default database (optional).
//'username' => '', // ACL - requires Redis >= 6.0 (optional).
//'password' => '', // Optional.
//'authfile' => '/run/secrets/file_name', // File with a password, e.g., Docker secrets (optional).
//'path' => '/var/run/redis/redis-server.sock', // Unix domain socket (optional).
//'databases' => 16, // Number of databases, use this if the CONFIG command is disabled (optional).
//'scanthreshold' => 100_000, // Use SCAN automatically instead of KEYS when the database has more keys than this, 1000 keys are retrieved (optional). Default 100_000.
//'scansize' => 1000, // Always use SCAN and retrieve at most this many keys, regardless of 'scanthreshold' (optional).
//'separator' => ':', // Separator for tree view (optional).
],
],
'memcached' => [
[
'name' => 'Localhost', // The server name, optional.
'host' => '127.0.0.1', // Optional when a path is specified.
'port' => 11211, // Optional when the default port is used.
//'path' => '/var/run/memcached/memcached.sock', // Unix domain socket (optional).
//'separator' => ':', // Separator for tree view (optional).
//'extension' => true, // Enable Memcached extension only for get and set operations (optional).
],
],
'apcuseparator' => ':', // Separator for tree view (optional).
'authusers' => [
// Auth is enabled when at least one user is defined. Leave it commented out (or empty) to disable.
//'admin' => 'your-password',
],
'authtoken' => 'your-secret-token', // Append &token=your-secret-token to the cronjob URL when auth is enabled.
// Decoding / Encoding functions
'converters' => [
'gzcompress' => [
'view' => static fn (string $value): ?string => @gzuncompress($value) !== false ? gzuncompress($value) : null,
'save' => static fn (string $value): string => gzcompress($value),
],
'gzencode' => [
'view' => static fn (string $value): ?string => @gzdecode($value) !== false ? gzdecode($value) : null,
'save' => static fn (string $value): string => gzencode($value),
],
'gzdeflate' => [
'view' => static fn (string $value): ?string => @gzinflate($value) !== false ? gzinflate($value) : null,
'save' => static fn (string $value): string => gzdeflate($value),
],
'zlib' => [
'view' => static fn (string $value): ?string => @zlib_decode($value) !== false ? zlib_decode($value) : null,
'save' => static fn (string $value): string => zlib_encode($value, ZLIB_ENCODING_DEFLATE),
],
/*'gz_magento' => [
'view' => static function (string $value): ?string {
$prefix = ':gz:';
$value = str_starts_with($value, $prefix) ? substr($value, strlen($prefix)) : $value;
return @gzuncompress($value) !== false ? gzuncompress($value) : null;
},
'save' => static fn (string $value): string => ':gz:'.gzcompress($value),
],*/
],
// Formatting functions, it runs after decoding
'formatters' => [
'unserialize' => static function (string $value): ?string {
$unserialized_value = @unserialize($value, ['allowed_classes' => false]);
if ($unserialized_value !== false && is_array($unserialized_value)) {
try {
return json_encode($unserialized_value, JSON_THROW_ON_ERROR);
} catch (JsonException) {
return null;
}
}
return null;
},
],
// Customizations
//'timezone' => 'Europe/Bratislava', // Leave empty (or commented out) to get it automatically obtained.
'timeformat' => 'd. m. Y H:i:s',
'decimalsep' => ',',
'thousandssep' => ' ',
'listview' => 'table', // table/tree - default key list view
'keymodal' => false, // Open the key view in a modal instead of a separate page - default false
'panelrefresh' => 30, // In seconds, refresh interval for panels - default 30
'metricsrefresh' => 60, // In seconds, refresh interval for metrics - default 60
'metricstab' => '1d', // Default tab in metrics, 1h - Last hour, 1d - Last day, 1w - Last week, 1m - Last month - default 1d
'hash' => 'pca', // Any random string to secure a metrics DB file.
'metricsdir' => __DIR__.'/tmp/metrics', // Directory for metrics DB files.
'twigcache' => __DIR__.'/tmp/twig', // Directory for Twig cache files.
//'pcapath' => 'vendor/robinn/phpcacheadmin/', // Path to the package when installed via composer. Used for assets.
//'url' => '/', // URL to the dashboard when installed via composer, e.g., /phpcacheadmin
];