PHPackages                             ggedde/spry-background-process - 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. ggedde/spry-background-process

ActiveSpryprovider

ggedde/spry-background-process
==============================

Provider for Spry Background Processes

1.0.5(5y ago)0831MITPHPPHP &gt;=5.4.0

Since Sep 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ggedde/spry-background-process)[ Packagist](https://packagist.org/packages/ggedde/spry-background-process)[ RSS](/packages/ggedde-spry-background-process/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (13)Used By (1)

spry-background-process
=======================

[](#spry-background-process)

Provider for Spry Background Processes

### Dependencies

[](#dependencies)

Background Processes -

### Requirements

[](#requirements)

- PHP 5.4^
- PHP with cli
- function "shell\_exec()" available.
- Spry-Core

Usage
-----

[](#usage)

```
use Spry\SpryProvider\SpryBackgroundProcess;

$process = [
	'controller' => 'Spry\\SpryComponent\\MyController::myMethod',
	'params' => [
		'id' => 123,
		'name' => 'Something'
	]
];

// Run the Process and return its unix ID
$process_id = SpryBackgroundProcess::create($process);

// Check to see if the process is still running
if(SpryBackgroundProcess::isRunning($process_id))
{
	// It is still running
}
else
{
	// It has finished
}

// Stop a Process by unix ID
SpryBackgroundProcess::stop($process_id);
```

Verify Process with Hash (Recommended)
--------------------------------------

[](#verify-process-with-hash-recommended)

Unix Process IDs get recycled so it is possible that the same ID may get used for another task. This could present faulty data when checking the to see if the process is still running OR worse you run the "stop" method on the ID, but the ID was for something else like PHP, Apache, Nginx, Etc which could halt your server entirely.

So a better option would be to verify the process with a Hash of Command and the Time of the command.
\* *Although this method has not been fully tested on all OS Versions.*

```
$process = [
	'controller' => 'Spry\\SpryComponent\\MyController::myMethod',
	'hash' => true,
	'params' => [
		'id' => 123,
		'name' => 'Something'
	]
];

// Run the Process and return its unix ID and Hash
$process_data = SpryBackgroundProcess::create($process);

// Check to see if the process is still running
if(SpryBackgroundProcess::isRunning($process_data['pid'], $process_data['hash']))
{
	// It is still running
}
else
{
	// It has finished
}

// Stop a Process by unix ID and Hash
SpryBackgroundProcess::stopIfIsRunning($process_data['pid'], $process_data['hash']);
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Recently: every ~9 days

Total

12

Last Release

2177d ago

Major Versions

0.9.5 → 1.0.02020-03-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/459f086623b58e334ff8f569a9cedaf847ff4fef97b1c9aceabb618f9e2006fa?d=identicon)[ggedde](/maintainers/ggedde)

---

Top Contributors

[![ggedde](https://avatars.githubusercontent.com/u/3236909?v=4)](https://github.com/ggedde "ggedde (16 commits)")

### Embed Badge

![Health badge](/badges/ggedde-spry-background-process/health.svg)

```
[![Health](https://phpackages.com/badges/ggedde-spry-background-process/health.svg)](https://phpackages.com/packages/ggedde-spry-background-process)
```

###  Alternatives

[mmucklo/queue-bundle

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}

120839.8k](/packages/mmucklo-queue-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
