PHP 클래스 Autarky\Files\LockingFilesystem

The object will add a file lock before writing and release it right after the contents have been written. This can be used to prevent corruption of data when multiple requests try to write to the same file at the same time.
파일 보기 프로젝트 열기: autarky/framework 1 사용 예제들

공개 메소드들

메소드 설명
read ( string $path, boolean $blocking = false ) : string Read from a file.
write ( string $path, string $contents, boolean $blocking = false ) : void Write to the file.

메소드 상세

read() 공개 메소드

Read from a file.
public read ( string $path, boolean $blocking = false ) : string
$path string Path to the file.
$blocking boolean Wait for other locks to expire rather than throwing an error when a lock cannot be aquired.
리턴 string

write() 공개 메소드

Write to the file.
public write ( string $path, string $contents, boolean $blocking = false ) : void
$path string Path to the file.
$contents string Contents to write to the file.
$blocking boolean Wait for other locks to expire rather than throwing an error when a lock cannot be aquired.
리턴 void