定制 benconstable/lock 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

benconstable/lock

最新稳定版本:v1.0.2

Composer 安装命令:

composer require benconstable/lock

包简介

Simple object-oriented file lock management

README 文档

README

Build Status Latest Stable Version License

The standard PHP flock function is difficult to test against. This library provides a modern, object-oriented wrapper to flock.

Installation

Add the following to your composer.json:

{
    "require": {
        "benconstable/lock": "~1.0"
    }
}

Usage

<?php

$lock = new BenConstable\Lock\Lock('/path/to/file.txt');

try {
    $lock->acquire();

    // Lock successful...

    // Release lock. Optional, as resource will also be released automatically
    // when the lock object is destroyed

    $lock->release();
} catch (BenConstable\Lock\Exception\LockException $e) {
    // Lock failed...
}

Development & contribution

To develop and/or contribute to this library, you must add tests for your code. Tests are built with Phpspec. To run them:

$ git clone https://github.com/BenConstable/lock && cd lock/
$ composer install
$ bin/phpspec run

统计信息

  • 总下载量: 1.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固