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:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace App\Framework\Filesystem\Traits;
use App\Framework\Filesystem\Exceptions\FileWriteException;
/**
* Trait für Atomic Storage-Operationen
*
* Implementiert atomare Schreiboperationen durch temporäre Dateien
* und rename()-Operation für Data Consistency.
*/
trait AtomicStorageTrait
{
public function putAtomic(string $path, string $content): void
{
$tempPath = $path . '.tmp.' . uniqid();
$this->put($tempPath, $content);
$resolvedPath = $this->resolvePath($path);
$resolvedTempPath = $this->resolvePath($tempPath);
if (! @rename($resolvedTempPath, $resolvedPath)) {
@unlink($resolvedTempPath);
throw new FileWriteException($path);
}
}
public function updateAtomic(string $path, callable $updateCallback): void
{
$originalContent = $this->exists($path) ? $this->get($path) : '';
$newContent = $updateCallback($originalContent);
$this->putAtomic($path, $newContent);
}
public function updateJsonAtomic(string $path, callable $updateCallback): void
{
$originalData = $this->exists($path) ? json_decode($this->get($path), true) ?? [] : [];
$newData = $updateCallback($originalData);
$this->putAtomic($path, json_encode($newData, JSON_PRETTY_PRINT));
}
}