Files
michaelschiemer/src/Framework/Filesystem/AtomicStorage.php
Michael Schiemer 55a330b223 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
2025-08-11 20:13:26 +02:00

36 lines
997 B
PHP

<?php
declare(strict_types=1);
namespace App\Framework\Filesystem;
/**
* Interface für atomare Storage-Operationen
*
* Garantiert, dass Schreiboperationen entweder vollständig erfolgen oder gar nicht.
* Verhindert korrupte/teilweise Dateien bei Concurrent Access oder System-Ausfällen.
*/
interface AtomicStorage
{
/**
* Atomare Schreiboperation
*
* Schreibt Inhalt atomisch (write + rename) um Race Conditions zu vermeiden.
*/
public function putAtomic(string $path, string $content): void;
/**
* Atomare Update-Operation mit Callback
*
* Lädt aktuelle Daten, führt Update-Callback aus und schreibt atomisch zurück.
*/
public function updateAtomic(string $path, callable $updateCallback): void;
/**
* Atomare JSON-Update-Operation
*
* Spezielle Implementierung für JSON-Updates um Parsing-Errors zu vermeiden.
*/
public function updateJsonAtomic(string $path, callable $updateCallback): void;
}