Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Cache\Compression;
|
||||
|
||||
use App\Framework\Cache\CompressionAlgorithm;
|
||||
@@ -7,7 +9,9 @@ use App\Framework\Cache\CompressionAlgorithm;
|
||||
final class GzipCompression implements CompressionAlgorithm
|
||||
{
|
||||
private const string PREFIX = 'gz:';
|
||||
|
||||
private int $level;
|
||||
|
||||
private int $threshold;
|
||||
|
||||
public function __construct(int $compressionLevel = -1, int $minLengthToCompress = 1024)
|
||||
@@ -18,7 +22,7 @@ final class GzipCompression implements CompressionAlgorithm
|
||||
|
||||
public function compress(string $value, bool $forceCompression = false): string
|
||||
{
|
||||
if (!$forceCompression && strlen($value) < $this->threshold) {
|
||||
if (! $forceCompression && strlen($value) < $this->threshold) {
|
||||
return $value;
|
||||
}
|
||||
$compressed = gzcompress($value, $this->level);
|
||||
@@ -26,16 +30,18 @@ final class GzipCompression implements CompressionAlgorithm
|
||||
// Fallback auf Originalwert bei Fehler
|
||||
return $value;
|
||||
}
|
||||
|
||||
return self::PREFIX . $compressed;
|
||||
}
|
||||
|
||||
public function decompress(string $value): string
|
||||
{
|
||||
if (!$this->isCompressed($value)) {
|
||||
if (! $this->isCompressed($value)) {
|
||||
return $value;
|
||||
}
|
||||
$raw = substr($value, strlen(self::PREFIX));
|
||||
$decompressed = @gzuncompress($raw);
|
||||
|
||||
return $decompressed !== false ? $decompressed : $value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user