Skip to content

Commit 41aad4e

Browse files
committed
Update config.dist.php
1 parent 3253af0 commit 41aad4e

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

config.dist.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,29 @@
8484
// Decoding / Encoding functions
8585
'converters' => [
8686
'gzcompress' => [
87-
'view' => static fn (string $value): ?string => extension_loaded('zlib') && @gzuncompress($value) !== false ? gzuncompress($value) : null,
88-
'save' => static fn (string $value): string => extension_loaded('zlib') ? gzcompress($value) : $value,
87+
'view' => static fn (string $value): ?string => @gzuncompress($value) !== false ? gzuncompress($value) : null,
88+
'save' => static fn (string $value): string => gzcompress($value),
8989
],
9090
'gzencode' => [
91-
'view' => static fn (string $value): ?string => extension_loaded('zlib') && @gzdecode($value) !== false ? gzdecode($value) : null,
92-
'save' => static fn (string $value): string => extension_loaded('zlib') ? gzencode($value) : $value,
91+
'view' => static fn (string $value): ?string => @gzdecode($value) !== false ? gzdecode($value) : null,
92+
'save' => static fn (string $value): string => gzencode($value),
9393
],
9494
'gzdeflate' => [
95-
'view' => static fn (string $value): ?string => extension_loaded('zlib') && @gzinflate($value) !== false ? gzinflate($value) : null,
96-
'save' => static fn (string $value): string => extension_loaded('zlib') ? gzdeflate($value) : $value,
95+
'view' => static fn (string $value): ?string => @gzinflate($value) !== false ? gzinflate($value) : null,
96+
'save' => static fn (string $value): string => gzdeflate($value),
97+
],
98+
'zlib' => [
99+
'view' => static fn (string $value): ?string => @zlib_decode($value) !== false ? zlib_decode($value) : null,
100+
'save' => static fn (string $value): string => zlib_encode($value, ZLIB_ENCODING_DEFLATE),
97101
],
98102
/*'gz_magento' => [
99103
'view' => static function (string $value): ?string {
100104
// https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/blob/master/Cm/Cache/Backend/Redis.php (_encodeData method)
101-
$value = str_starts_with($value, "gz:\x1f\x8b") ? substr($value, 5) : $value;
105+
$value = str_starts_with($value, "gz:\x1f\x8b") ? substr($value, 5);
102106
103-
return extension_loaded('zlib') && @gzuncompress($value) !== false ? gzuncompress($value) : null;
107+
return @gzuncompress($value) !== false ? gzuncompress($value) : null;
104108
},
105-
'save' => static fn (string $value): string => extension_loaded('zlib') ? "gz:\x1f\x8b".gzcompress($value) : $value,
109+
'save' => static fn (string $value): string => "gz:\x1f\x8b".gzcompress($value),
106110
],*/
107111
],
108112
// Formatting functions, it runs after decoding

0 commit comments

Comments
 (0)