Need help with safe-writer?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

webimpress
329 Stars 5 Forks BSD 2-Clause "Simplified" License 90 Commits 3 Opened issues

Description

Write files safely, to avoid race conditions

Services available

!
?

Need anything else?

Contributors list

# 479,606
json-schema 3.0K PHP top 10

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.