Hugo Sales e8e8000b16 Update composer dependencies пре 4 година
..
src e8e8000b16 Update composer dependencies пре 4 година
CHANGELOG.md e8e8000b16 Update composer dependencies пре 4 година
LICENSE.md e8e8000b16 Update composer dependencies пре 4 година
README.md e8e8000b16 Update composer dependencies пре 4 година
composer.json e8e8000b16 Update composer dependencies пре 4 година
composer.lock e8e8000b16 Update composer dependencies пре 4 година
psalm.xml e8e8000b16 Update composer dependencies пре 4 година

README.md

Webimpress Safe Writer

Build Status Coverage Status

Write files safely to avoid race conditions when the same file is written multiple times in a short time period.

Installation

Using composer:

$ composer require webimpress/safe-writer

Usage

use Webimpress\SafeWriter\FileWriter;

$targetFile = __DIR__ . '/target-file.php';
$content = "<?php\nreturn " . var_export($data, true) . ';';

FileWriter::writeFile($targetFile, $content);

If something goes wrong exception (instance of Webimpress\SafeWriter\Exception\ExceptionInterface) will be thrown.