PHP Safe File Write: Write to files avoiding simultaneous accesses

Recommend this page to a friend!
  Info   Documentation   View files (19)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 213 All time: 8,175 This week: 307
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: 1934253 in United States United States
Week rank: 771 80 in United States United States
Innovation award
Innovation award
Nominee: 7x

Winner: 1x



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

File Role Description
specs (1 directory)
src (7 files)
.coveralls.yml Data Auxiliary data
.scrutinizer.yml Data Auxiliary data
.travis.yml Data Auxiliary data
composer.json Data Auxiliary data Data Auxiliary data Data Auxiliary data
phpspec.yml.dist Data Auxiliary data
phpspec_coverage.yml Data Auxiliary data Doc. Documentation

  Files  /  specs  
File Role Description
Spec (3 files)

  Files  /  specs  /  Spec  
File Role Description
   ErrorHandlingTraitSpec.php Class Class source
   MockErrorHandling.php Class Class source
   SafeFileErrorSpec.php Class Class source

  Files  /  src  
File Role Description
   bootstrap.php Aux. Auxiliary script
   ErrorHandlingInterface.php Class Class source
   ErrorHandlingTrait.php Class Class source
   SafeFile.php Class Class source
   SafeFileError.php Class Class source
   SafeFileHandlingTrait.php Class Class source
   SharedFileMethodsTrait.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,175
This week:307

For more information send a message to info at phpclasses dot org.