PHPackages                             graftype/nohup - 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. [CLI &amp; Console](/categories/cli)
4. /
5. graftype/nohup

ActiveLibrary[CLI &amp; Console](/categories/cli)

graftype/nohup
==============

A library to run a command in the background, it will return the process's pid, and get it's is running status anytime in the another process, and can be stoped anytime.

1.0.13(3mo ago)152MITPHP

Since Aug 9Pushed 3mo agoCompare

[ Source](https://github.com/graftype/nohup)[ Packagist](https://packagist.org/packages/graftype/nohup)[ RSS](/packages/graftype-nohup/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

php-nohup
=========

[](#php-nohup)

A library to run a command in the background, it will return the process's pid, and get it's is running status anytime in the another process, and can be stoped anytime.

Navigation
==========

[](#navigation)

- [Installation](#installation)
- [Usage](#usage)
    - [Run a script in background](#run-a-script-in-background)
    - [Create process from known pid ($pid)](#create-process-from-known-pid-pid)

Installation
============

[](#installation)

Using composer:

```
composer require graftype/nohup
```

Usage
=====

[](#usage)

Run a script in background
--------------------------

[](#run-a-script-in-background)

```
use graftype\nohup;

$process = Nohup::run('sleep 5');
```

It will be running in the background for 5 seconds.

But, it can be stoped any time:

```
//...
$process->stop();
```

It stoped now!

Get the pid : `$process->getPid()`, it will return the real pid in both window and \*inx system.

Get it's running status with the function `$process->isRunning()`:

```
use graftype\nohup\Nohup;

$process = Nohup::run('sleep 5');
while ($process->isRunning()) {
    echo '.';
    sleep(1);
}
echo "Done.\n";
```

*output*: `.....Done.`

Create process from known pid ($pid)
------------------------------------

[](#create-process-from-known-pid-pid)

```
use graftype\nohup\Process;

$process = Process::loadFromPid($pid);
// or
$process = new Process($pid);

if ($process->isRunning()) {
    $process->stop();
}
```

### Method:

[](#method)

`Nohup::run($commandLine, $outputFile, $errorFile)`

- `$commandLine`: string, the command will be run.
- `$outputFile`: string, the file path where to save output content.
- `$errlogFile`: string, the file path where to save error message.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance81

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~105 days

Recently: every ~204 days

Total

14

Last Release

102d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40078038?v=4)[Sergey Komlev](/maintainers/sergeykomlev)[@sergeykomlev](https://github.com/sergeykomlev)

---

Top Contributors

[![sergeykomlev](https://avatars.githubusercontent.com/u/40078038?v=4)](https://github.com/sergeykomlev "sergeykomlev (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/graftype-nohup/health.svg)

```
[![Health](https://phpackages.com/badges/graftype-nohup/health.svg)](https://phpackages.com/packages/graftype-nohup)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k113.1M998](/packages/laravel-socialite)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[shopware/administration

Administration frontend for the Shopware Core

404.5M135](/packages/shopware-administration)

PHPackages © 2026

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