-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathconfig.dist.php
More file actions
158 lines (147 loc) · 7.25 KB
/
config.dist.php
File metadata and controls
158 lines (147 loc) · 7.25 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?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).
//'scansize' => 1000, // Number of keys, the server will use the SCAN command instead of KEYS (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).
// Example of authentication with http auth.
/*'auth' => static function (): void {
$username = 'admin';
$password = 'pass';
if (isset($_GET['logout'])) {
setcookie('auth_reset', '1', time() + 60, '/');
$clean_uri = strtok($_SERVER['REQUEST_URI'], '?');
$is_https = (
(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] === 1)) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
);
header('Location: http'.($is_https ? 's' : '').'://'.$_SERVER['HTTP_HOST'].$clean_uri);
exit;
}
if (isset($_COOKIE['auth_reset'])) {
setcookie('auth_reset', '', time() - 3600, '/');
header('WWW-Authenticate: Basic realm="phpCacheAdmin Login"');
header('HTTP/1.0 401 Unauthorized');
exit('You have been logged out.');
}
if (
!isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) ||
$_SERVER['PHP_AUTH_USER'] !== $username || $_SERVER['PHP_AUTH_PW'] !== $password
) {
header('WWW-Authenticate: Basic realm="phpCacheAdmin Login"');
header('HTTP/1.0 401 Unauthorized');
exit('Incorrect username or password!');
}
},*/
// 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.
'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
];