PHPackages                             nyugodt/proc - 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. nyugodt/proc

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

nyugodt/proc
============

An utility library for process related functionality for PHP.

v1.1.0(5y ago)03MITPHP

Since Oct 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rgalex2034/php-proc)[ Packagist](https://packagist.org/packages/nyugodt/proc)[ RSS](/packages/nyugodt-proc/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

php-proc
========

[](#php-proc)

An utility library for process related functionality for PHP.

Dependencies
------------

[](#dependencies)

This library depends on the semaphore, shared memory and ipc functions of PHP for the use of the `SemLock` class, which are not available on Windows.

Usage
-----

[](#usage)

This library provides two classes, `FileLock` and `SemLock`. Both works in the same way. They can be instantiated by a `::newInstance()` method, which accepts an optional parameter as a path. If a lock is created with the same path in different processes, only one of them will be able to execute code inside the `synchronize()` call. Once a process ends it's `synchronize()` call, it releases the lock and another process takes the execution.

If no path is provided, it gets the full path of the calling file.

```
