PHP Classes

PHP Safe File Write: Write to files avoiding simultaneous accesses

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 221 All time: 8,263 This week: 488Up
Version License PHP version Categories
safe-file-operations 1.0.0GNU General Publi...5PHP 5, Files and Folders
Description 

Author

This package can write to files avoiding simultaneous accesses.

In can perform several types of operations to access files in a way that prevents file corruptions when two or more PHP scripts attempt to write to the same file.

The package provides traits that can be used by other classes to perform safe operations for file reading and writing using file locks.

Innovation Award
PHP Programming Innovation award nominee
April 2019
Number 3


Prize: One official elePHPant Plush Mascott
Many applications need to store information in files.

If several requests handled by scripts of an application attempt to change the same file at the same time, it is necessary to use locking mechanisms like file locking to prevent that multiple accesses change the same file with different information.

This package provides a trait that can be used by many different classes to change files while assuring data consistency by the means of the use of file locks.

Manuel Lemos
Picture of Michael Cummings
  Performance   Level  
Name: Michael Cummings <contact>
Classes: 9 packages by
Country: United States United States
Age: ???
All time rank: 1895263 in United States United States
Week rank: 206 Up24 in United States United States Up
Innovation award
Innovation award
Nominee: 7x

Winner: 1x

Documentation

safe-file-operations

Proves as completely safe read and write file operations as possible.


  Files folder image Files (19)  
File Role Description
Files folder imagespecs (1 directory)
Files folder imagesrc (7 files)
Accessible without login Plain text file .coveralls.yml Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file COPYING-LESSER.md Data Auxiliary data
Accessible without login Plain text file COPYING.md Data Auxiliary data
Accessible without login Plain text file phpspec.yml.dist Data Auxiliary data
Accessible without login Plain text file phpspec_coverage.yml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (19)  /  specs  
File Role Description
Files folder imageSpec (3 files)

  Files folder image Files (19)  /  specs  /  Spec  
File Role Description
  Plain text file ErrorHandlingTraitSpec.php Class Class source
  Plain text file MockErrorHandling.php Class Class source
  Plain text file SafeFileErrorSpec.php Class Class source

  Files folder image Files (19)  /  src  
File Role Description
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Plain text file ErrorHandlingInterface.php Class Class source
  Plain text file ErrorHandlingTrait.php Class Class source
  Plain text file SafeFile.php Class Class source
  Plain text file SafeFileError.php Class Class source
  Plain text file SafeFileHandlingTrait.php Class Class source
  Plain text file SharedFileMethodsTrait.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:221
This week:0
All time:8,263
This week:488Up