webimpress/safe-writer
Tool to write files safely, to avoid race conditions
2.2.0
44M downloads/mo
#713 most downloaded on Packagist
webimpress/safe-writer
What this package is like to depend on
Last release 5 years ago
no release in 18 months
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 7 of 7 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
7 releases · first in 2019
0 releases in the last 12 months
see the full history below
Release timeline
7 releases · Nov 2019 to Apr 2021Releases
latest 7-
2.2.019 Apr 2021Release notes
Open source →Added
- Nothing.
Changed
- #50 changes suppressing warnings in
FileWriter::writeFilemethod. Custom error handler is used instead of@, so it is not possible to handle them outside anymore.
Deprecated
- Nothing.
Removed
- #51 removes support for PHP 7.2.
Fixed
- Nothing.
Release notes
Open source →Added
- Nothing.
Changed
- #50 changes suppressing warnings in
FileWriter::writeFilemethod. Custom error handler is used instead of@, so it is not possible to handle them outside anymore.
Deprecated
- Nothing.
Removed
- #51 removes support for PHP 7.2.
Fixed
- Nothing.
-
2.1.025 Aug 2020Release notes
Open source →Added
- #7 adds support for PHP 8.0.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
Release notes
Open source →Added
- #7 adds support for PHP 8.0.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
-
2.0.121 Mar 2020Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #6 fixes issue when target directory is not writeable - throws exception earlier and prevents fallback to system temp directory.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #6 fixes issue when target directory is not writeable - throws exception earlier and prevents fallback to system temp directory.
-
2.0.027 Nov 2019Release notes
Open source →Added
- #5 adds
\Throwableextension for package-specific exception markerWebimpress\SafeWriter\Exception\ExceptionInterface.
Changed
-
#5 changes all exception classes to be non-instantiable and all theirs public method to be internal.
Library exceptions can only be caught in the user code, cannot be thrown. -
#5 changes all method declarations to have type hints and return types.
Deprecated
- Nothing.
Removed
- #5 removes support for PHP versions prior to 7.2.
Fixed
- Nothing.
Release notes
Open source →Added
- #5 adds
\Throwableextension for package-specific exception markerWebimpress\SafeWriter\Exception\ExceptionInterface.
Changed
-
#5 changes all exception classes to be non-instantiable and all theirs public method to be internal. Library exceptions can only be caught in the user code, cannot be thrown.
-
#5 changes all method declarations to have type hints and return types.
Deprecated
- Nothing.
Removed
- #5 removes support for PHP versions prior to 7.2.
Fixed
- Nothing.
- #5 adds
-
1.0.221 Mar 2020Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #6 fixes issue when target directory is not writeable - throws exception earlier and prevents fallback to system temp directory.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #6 fixes issue when target directory is not writeable - throws exception earlier and prevents fallback to system temp directory.
-
1.0.116 Nov 2019Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #4 fixes exception message when temporary file cannot be created.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #4 fixes exception message when temporary file cannot be created.
-
1.0.015 Nov 2019Release notes
Open source →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.
Release notes
Open source →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.
-