filelock
v1.0.0
Pustaka php sederhana yang menyediakan antarmuka OOP ke kunci file.
composer require dorantor/ filelock
<?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 ();
Ide, antarmuka, dan beberapa kode diambil tanpa malu-malu dari benconstable/lock.