php-component/atomic-file

文件原子操作库

0.1.3 2017-09-23 12:52 UTC

This package is not auto-updated.

Last update: 2024-09-29 03:06:02 UTC


README

AtomicFile 是一个用于文件原子操作的包。它确保在写入/读取文件时,没有人会覆盖您的文件。

$file_path = dirname(__FILE__).'/../tmp/test.txt';
$reader = new PHPComponent\AtomicFile\AtomicFileReader($file_path); //create instance of Reader
print_r($reader->readFile()); //read file

重要通知

它仅在其他写入者/读取者使用相同的类时才有效,flock() 函数无法为 flock() 函数以外的函数锁定文件。