PHPackages                             soarce/client - 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. soarce/client

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

soarce/client
=============

This is the client for SOARCE providing and endpoint for external code coverage collection and more.

5.0.3(10mo ago)3611[6 issues](https://github.com/soarce-qa/soarce-client-php/issues)[1 PRs](https://github.com/soarce-qa/soarce-client-php/pulls)MITPHPPHP &gt;=8.0,&lt;9.0-DEVCI passing

Since Jul 13Pushed 3w ago1 watchersCompare

[ Source](https://github.com/soarce-qa/soarce-client-php)[ Packagist](https://packagist.org/packages/soarce/client)[ Docs](https://github.com/soarce-qa/soarce-client-php)[ RSS](/packages/soarce-client/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (57)Used By (0)

soarce/client [![Packagist](https://camo.githubusercontent.com/a4021495b466a20ee7961f22899fa32eb72ca5a70e36cb5a7f868537123ad64f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f617263652f636c69656e742e737667)](https://packagist.org/packages/soarce/client)
==========================================================================================================================================================================================================================================================================================

[](#soarceclient-)

Version: 4.0.1
--------------

[](#version-401)

Overview
--------

[](#overview)

This package is the client part of SOARCE - a tool for collecting, reading and analyzing PHP code coverage withing a service oriented architecture / microservice environment. It has to be installed per service as a dev requirement. This library will intercept certain calls to the service/application and either execute necessary code for collecting and storing coverage before/after the actual application code or execute it's own actions instead (e.g. handing out coverage data to the master application).

### DO NOT USE IN PRODUCTION!

[](#do-not-use-in-production)

Althought there will be security measures in place, include this library only as a --dev dependency. The intended use is local development or use within a CI/CD pipeline. See documentation for more advanced examples.

### Versions

[](#versions)

This tool is inteded to help with legacy software maintenance and upgrades. Because of this we have multiple versions of this client available, supporting legacy versions of PHP down to PHP 5.3.9. The current minimum PHP-Version for the master branch and active development is the oldest supported PHP versions by php.net. Whenever EOL of one is reached, we'll create a new major version and there drop support. Currently the following branches are available:

- 1.x - PHP 5.3.9 -- deprecated
- 2.x - PHP 5.4 - 5.6 -- deprecated
- 3.x - PHP 7.0 -- deprecated
- 4.x - PHP 7.2+ -- xdebug 3 is needed!
- 5.x/master

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

[](#installation)

composer.json:

```
{
  "require-dev": {
    "soarce/client": "*"
  }
}
```

or preferably run this composer command in your project root:

```
$ composer require --dev --prefer-dist "soarce/client"

```

In addition, you will have to install and enable xdebug in order to generate code coverage. It has not been included in the "required" section as it would disallow composer-runs without it.

Configuration
-------------

[](#configuration)

### ENV-Variables

[](#env-variables)

- string `SOARCE_ACTION_PARAM_NAME` = "SOARCE": names the SOARCE interceptor param name. Use something long and random to obfuscate an active SOARCE client if necessary and/or to solve parameter name conflicts with your application. It has to match the main application's parameter name setting.
- string `SOARCE_APPLICATION_NAME` = $\_SERVER\['HOSTNAME'\]: names the server/application for gathering the stats. This should be the same name used in the main application's config. As a fallback the "HOSTNAME" server variable will be used - with docker this means defaulting to the docker container's id.
- string `SOARCE_DATA_PATH` = "/tmp/": any writable location on your server / in your container. Named pipes, trigger and pid-files will be written there. If you host multiple services from the same host or container, make sure they use different `SOARCE_DATA_PATH`s. Coverage is sent directly to the master application, trace is written to the named pipes, parsed in memory and the result then sent to the master.
- string `SOARCE_WHITELISTED_HOST_IPS` = "": a comma-separated list of IPv4 and IPv6 addresses that should be able to access SOARCE commands and resources through this plugin. The empty default means no whitelisting active and permits all requests. This is the default as SOARCE is a development tool and should not be accessible from public networks anyways.
- string `SOARCE_WHITELISTED_PATHS` = "": a PATH\_SEPARATOR (:) separated list of paths out of which SOARCE is allowed to handout sourcecode on request - to display in code coverage views. You should include all possible source code and library paths - a good start is usually the `common_path` parameter in the application's config, for example "/var/www". As with the IP whitelist, an empty path whitelist disables the feature as SOARCE should only be used in closed environments.
- string `SOARCE_PRESHARED_SECRET` = "": an arbitrary string which - if used - has to be identical to the respective config key in the application's config. It is being sent as a HTTP header to effectively reduce drive-by or XSS attacks as well as brute-force attempts to guess how to access SOARCE on a certain system.

### X-Debug

[](#x-debug)

```
xdebug.auto_trace = 0
xdebug.trace_format = 1
xdebug.trace_enable_trigger = 0

```

This might be counterintuitive, but, SOARCE triggers coverage and tracing itself.

### docker-compose

[](#docker-compose)

Currently the client expects a few preconditions at static hostnames/addresses - we plan to add configuration options later:

- the main application will be expected at the address ""
- the redis server (for reliable mutex locking of the pipes) at "tcp://soarce.local:6379"
- clone the application [soarce/application](https://gitlab.home.segnitz.net/soarce/application) and run `docker-compose up` for it, it will create and run the necessary services within a virtual network.
- make sure that the containers you install this package to can access the aforementioned services. This can be achieved for example by running them with docker-compose and putting them into the same virtual network:
    - for your application container (e.g. php-fpm or apache + mod\_php) add a new network to the current one so it looks for example like this: ```
        services:
          my-app:
            build: [...]
            volumes: [...]
            links: [...]
            networks:
              default:
                aliases:
                  - my-app.local
              soarce_default:

        ```
    - define the network `soarce_default` as an external network by adding this to the end of your docker-compose.yml: ```
        networks:
          soarce_default:
            external: true

        ```

Known Issues
------------

[](#known-issues)

### Security

[](#security)

- Component requires xdebug to be active

### Separating Requests

[](#separating-requests)

For within a service architecture we just added a feature that automatically detects the request-id of the parent request and the sequence number of child requests within that parent request. This currently only works in it's zero-conf mode when each service is running in it's own VM or docker container - having a separate IP address - and without having gaps inbetween - like loadbalancers or services not equipped with an active SOARCE client. We'll add additional support options in the future.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance56

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

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

Recently: every ~1 days

Total

50

Last Release

329d ago

Major Versions

2.0.1 → 3.0.12020-02-29

3.0.1 → 4.0.12020-02-29

4.0.1 → 5.0.02025-06-08

4.1.1 → 5.0.12025-06-12

4.1.4 → 5.0.22025-06-14

PHP version history (8 changes)0.0.2PHP ^7.1

0.0.4PHP &gt;=7.1,&lt;8.0-DEV

1.0.0PHP &gt;=5.3,&lt;8.0-DEV

2.0.0PHP &gt;=5.4,&lt;8.0-DEV

3.0.0PHP &gt;=7.0,&lt;8.0-DEV

2.0.1PHP &gt;=5.5,&lt;8.0-DEV

5.0.0PHP &gt;=8.0,&lt;9.0-DEV

4.1.0PHP &gt;=7.2,&lt;8.0-DEV

### Community

Maintainers

![](https://www.gravatar.com/avatar/295944cfad74862d4d4038cdea8c6bb68e2c4d5e2339042e9050d6b2df6d27b3?d=identicon)[hsegnitz](/maintainers/hsegnitz)

---

Top Contributors

[![hsegnitz](https://avatars.githubusercontent.com/u/2615958?v=4)](https://github.com/hsegnitz "hsegnitz (162 commits)")

---

Tags

testingXdebugqacodecoverageSOARCE

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/soarce-client/health.svg)

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

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k910.7M134.8k](/packages/phpunit-phpunit)[phpunit/php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

8.9k892.4M1.5k](/packages/phpunit-php-code-coverage)[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[sebastian/environment

Provides functionality to handle HHVM/PHP environments

6.8k871.7M66](/packages/sebastian-environment)[phpmetrics/phpmetrics

Static analyzer tool for PHP : Coupling, Cyclomatic complexity, Maintainability Index, Halstead's metrics... and more !

2.6k14.5M299](/packages/phpmetrics-phpmetrics)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)

PHPackages © 2026

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