PHPackages                             epsiloncool/db-semaphore - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. epsiloncool/db-semaphore

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

epsiloncool/db-semaphore
========================

A short and effective semaphore implementation in pure PHP

00PHP

Since May 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Epsiloncool/db-semaphore)[ Packagist](https://packagist.org/packages/epsiloncool/db-semaphore)[ RSS](/packages/epsiloncool-db-semaphore/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

db-semaphore
============

[](#db-semaphore)

A short and effective semaphore implementation in pure PHP

This library could be used if you want to manage one piece of the PHP code which have to be run only once.

The great place where it could be used is a cronjob script. While cron job will be runned periodically by the OS, we should not run the script if it's still executing from the previous run. Semaphore will help in this situation.

Installation
------------

[](#installation)

Install the latest version with

```
$ composer require epsiloncool/db-semaphore

```

Import sql dump from the file `sql/dbsem_locks.sql`

Basic Usage
-----------

[](#basic-usage)

```
