Skip to content

ivancoff/filelock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileLock

Latest Stable Version License

Simple php library providing OOP-interface to file locks.

Installation

composer require dorantor/filelock

Usage

<?php
 
// create lock object
$lock = new \Dorantor\FileLock('path/to/file');

// ..and work with it
if ($lock->acquire()) {
    // file is locked
    $lock->release();
}
 
// ..or it could be
if (!$lock->acquire()) {
    // failed with lock
    return;
}
// file was locked
$lock->release();

Credits

Idea, interfaces and some code shamelessly taken from benconstable/lock.

About

Simple php file lock library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%