Skip to content

safe-writer 1.0.0

Choose a tag to compare

@michalbundyra michalbundyra released this 15 Nov 21:57
· 142 commits to master since this release
1.0.0
4b0eb7c

Added

  • Adds function to safely writing files to avoid race conditions when
    the same file is written multiple times in a short time period,
    and errors on reading not fully written files. Example usage:

    use Webimpress\SafeWriter\FileWriter;
    
    $targetFile = __DIR__ . '/config-cache.php';
    $content = "<?php\nreturn " . var_export($data, true) . ';';
    
    FileWriter::writeFile($targetFile, $content, 0666);

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • Nothing.