PHPackages                             upscale/swoole-launchpad - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. upscale/swoole-launchpad

ActiveLibrary[Testing &amp; Quality](/categories/testing)

upscale/swoole-launchpad
========================

Swoole server process management

2.2.0(1y ago)19.3k3Apache-2.0PHPPHP &gt;=8.0CI failing

Since Nov 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/upscalesoftware/swoole-launchpad)[ Packagist](https://packagist.org/packages/upscale/swoole-launchpad)[ Docs](https://github.com/upscalesoftware/swoole-launchpad)[ RSS](/packages/upscale-swoole-launchpad/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (8)Used By (3)

Swoole Launchpad [![Build Status](https://github.com/upscalesoftware/swoole-launchpad/workflows/Tests/badge.svg?branch=master)](https://github.com/upscalesoftware/swoole-launchpad/actions?query=workflow%3ATests+branch%3Amaster)
===================================================================================================================================================================================================================================

[](#swoole-launchpad-)

This library extends the process management capabilities of [Swoole](https://github.com/swoole/swoole-src) / [Open Swoole](https://github.com/openswoole/swoole-src).

**Features:**

- Swoole server launch in child process
- Swoole server process termination
- [PHPUnit](https://phpunit.de/) testing framework compatibility

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

[](#installation)

The library is to be installed via [Composer](https://getcomposer.org/) as a dependency:

```
composer require upscale/swoole-launchpad
```

Usage
-----

[](#usage)

### PHPUnit Tests

[](#phpunit-tests)

The library is particularly useful in PHPUnit-based automated tests:

```
vendor/bin/phpunit --process-isolation
```

```
class HttpServerTest extends \PHPUnit\Framework\TestCase
{
    protected \Swoole\Http\Server $server;

    protected \Upscale\Swoole\Launchpad\ProcessManager $processManager;

    protected int $pid;

    protected function setUp(): void
    {
        $this->server = new \Swoole\Http\Server('127.0.0.1', 8080);
        $this->server->set([
            'log_file' => '/dev/null',
            'log_level' => 4,
            'worker_num' => 1,
        ]);

        $this->processManager = new \Upscale\Swoole\Launchpad\ProcessManager();
    }

    protected function tearDown(): void
    {
        $this->processManager->kill($this->pid);
    }

    public function testResponseStatus()
    {
        $this->server->on('request', function ($request, $response) {
            $response->status(404);
            $response->end();
        });
        $this->pid = $this->processManager->spawn($this->server);

        $result = `curl http://127.0.0.1:8080/ -s -i`;
        $this->assertStringStartsWith('HTTP/1.1 404 Not Found', $result);
    }

    public function testResponseBody()
    {
        $this->server->on('request', function ($request, $response) {
            $response->end('Success');
        });
        $this->pid = $this->processManager->spawn($this->server);

        $result = `curl http://127.0.0.1:8080/ -s -i`;
        $this->assertStringStartsWith('HTTP/1.1 200 OK', $result);
        $this->assertStringEndsWith('Success', $result);
    }
}
```

More compact version:

```
class HttpServerTest extends \Upscale\Swoole\Launchpad\Tests\TestCase
{
    protected function setUp(): void
    {
        parent::setUp();

        $this->server = new \Swoole\Http\Server('127.0.0.1', 8080);
        $this->server->set([
            'log_file' => '/dev/null',
            'log_level' => 4,
            'worker_num' => 1,
        ]);
    }

    public function testResponseStatus()
    {
        $this->server->on('request', function ($request, $response) {
            $response->status(404);
            $response->end();
        });
        $this->spawn($this->server);

        $result = $this->curl('http://127.0.0.1:8080/');
        $this->assertStringStartsWith('HTTP/1.1 404 Not Found', $result);
    }

    public function testResponseBody()
    {
        $this->server->on('request', function ($request, $response) {
            $response->end('Success');
        });
        $this->spawn($this->server);

        $result = $this->curl('http://127.0.0.1:8080/');
        $this->assertStringStartsWith('HTTP/1.1 200 OK', $result);
        $this->assertStringEndsWith('Success', $result);
    }
}
```

Make sure to autoload the test classes in your `composer.json`:

```
{
    "require-dev": {
        "phpunit/phpunit": "^9.5",
        "upscale/swoole-launchpad": "^2.0"
    },
    "autoload-dev": {
        "psr-4": {
            "Upscale\\Swoole\\Launchpad\\Tests\\": "vendor/upscale/swoole-launchpad/tests/"
        }
    }
}
```

Contributing
------------

[](#contributing)

Pull Requests with fixes and improvements are welcome!

License
-------

[](#license)

Copyright © Upscale Software. All rights reserved.

Licensed under the [Apache License, Version 2.0](https://github.com/upscalesoftware/swoole-launchpad/blob/master/LICENSE.txt).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance43

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

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

Recently: every ~463 days

Total

7

Last Release

457d ago

Major Versions

1.2.0 → 2.0.02022-11-22

PHP version history (3 changes)1.0.0PHP &gt;=5.6

1.2.0PHP &gt;=7.1

2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ff1791f1bd72221702e39e356c25b108de26dea1f5b56416f7957e8fa43ea92?d=identicon)[upscalesoftware](/maintainers/upscalesoftware)

---

Top Contributors

[![sshymko](https://avatars.githubusercontent.com/u/1231423?v=4)](https://github.com/sshymko "sshymko (30 commits)")

---

Tags

schedulerphpunitserverprocesstestsmanagerswooleforkdaemonspawn

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/upscale-swoole-launchpad/health.svg)

```
[![Health](https://phpackages.com/badges/upscale-swoole-launchpad/health.svg)](https://phpackages.com/packages/upscale-swoole-launchpad)
```

###  Alternatives

[whatthejeff/nyancat-phpunit-resultprinter

Nyan Cat result printer for PHPUnit

283689.8k24](/packages/whatthejeff-nyancat-phpunit-resultprinter)[mcustiel/phiremock

A mocker for HTTP and REST services. Full bundle.

151947.1k5](/packages/mcustiel-phiremock)[arara/process

Provides a better API to work with processes on Unix-like systems

16861.7k2](/packages/arara-process)[hot/phpunit-runner

The lib allows to watch phpunit tests

3066.9k4](/packages/hot-phpunit-runner)[mcustiel/phiremock-codeception-extension

Codeception extension for Phiremock. Allows to stub remote services for HTTP requests.

311.0M5](/packages/mcustiel-phiremock-codeception-extension)[aik099/phpunit-mink

Library for using Mink in PHPUnit tests. Supports session sharing between tests in a test case.

72136.2k1](/packages/aik099-phpunit-mink)

PHPackages © 2026

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