PHPackages                             muxx/dplr - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. muxx/dplr

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

muxx/dplr
=========

Object oriented deployer based on GoSSHa

v3.2.0(9mo ago)475.2k1[1 issues](https://github.com/muxx/dplr/issues)[3 PRs](https://github.com/muxx/dplr/pulls)MITPHPPHP &gt;=8.0CI failing

Since Feb 11Pushed 9mo ago4 watchersCompare

[ Source](https://github.com/muxx/dplr)[ Packagist](https://packagist.org/packages/muxx/dplr)[ Docs](https://github.com/muxx/dplr)[ RSS](/packages/muxx-dplr/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (2)Versions (20)Used By (0)

dplr
----

[](#dplr)

[![](https://github.com/muxx/dplr/workflows/CI/badge.svg)](https://github.com/muxx/dplr/workflows/CI/badge.svg)

Object oriented deployer based on [GoSSHa](https://github.com/YuriyNasretdinov/GoSSHa) which allows to execute tasks simultaneously and in parallel. Simple and fast.

- [Installation](#installation)
- [Documentation](#documentation)
    - [Initialization](#initialization)
    - [Register servers](#register-servers)
    - [Register tasks](#register-tasks)
    - [Running](#running)
    - [Result processing](#result-processing)
- [Tests](#tests)

Usage
-----

[](#usage)

Example of usage:

```
require 'vendor/autoload.php';

$dplr = new Dplr\Dplr('ssh-user', '/path/to/GoSSHa');

$dplr
    ->addServer('front1.site.ru', 'front')
    ->addServer('front2.site.ru', 'front')
    ->addServer('job1.site.ru', ['job', 'master'])
    ->addServer('job2.site.ru', 'job')
;

const PATH = '/home/webmaster/product';

$dplr
    ->upload('/path/to/local_file1', '/path/to/remote_file1', 'front')
    ->command(PATH . '/app/console cache:clear')
;

$dplr->run(function($step) {
    echo $step;
});

if (!$dplr->isSuccessful()) {
    echo "Deploy completed with errors.\n";
    foreach($dplr->getFailed() as $item) {
        echo "[ " . $item . " ]\n" . $item->getErrorOutput() . "\n";
    }
}
else {
    echo "Deploy completed successfully.\n";
}

$report = $dplr->getReport();
echo sprintf(
    "Tasks: %s total, %s successful, %s failed.\nTime of execution: %s\n",
    $report['total'],
    $report['successful'],
    $report['failed'],
    $report['timers']['execution']
);
```

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

[](#installation)

Use composer to install **dplr**:

```
"require": {
    "muxx/dplr": "~1.0"
}

```

**Important**: `dplr` requires [GoSSHa](https://github.com/YuriyNasretdinov/GoSSHa).

Documentation
-------------

[](#documentation)

### Initialization

[](#initialization)

Initialization of ssh authorization by key:

```
$dplr = new Dplr\Dplr('ssh-user', '/path/to/GoSSHa');

// or

$dplr = new Dplr\Dplr('ssh-user', '/path/to/GoSSHa', '/path/to/public.key');
```

### Register servers

[](#register-servers)

Add multiply servers with adding in different group. Adding to groups allows you to execute tasks on servers of certain group.

```
$dplr->addServer('1.2.3.4'); // Add server IP 1.2.3.4 without adding to group
$dplr->addServer('1.2.3.5', 'app'); // Add server IP 1.2.3.5 with adding to group 'app'
$dplr->addServer('1.2.3.6', ['app', 'cache']); // Add server IP 1.2.3.6 with adding to groups 'app' and 'cache'
$dplr->addServer('1.2.3.7:2222', ['cache']); // Add server IP 1.2.3.7 and ssh port 2222 with adding to group 'cache'
```

### Register tasks

[](#register-tasks)

`dplr` allows to register two types of tasks:

- Command executing
- Upload local file to remote server

```
$local = __DIR__;
$path = '/home/webmaster/project';

$dplr
    ->upload("$local/share/parameters.yml", "$path/app/config/parameters.yml")
    ->command("cd $path && ./app/console cache:clear --env=prod --no-debug", 'app', 15)
;
```

In example above file `parameters.yml` will be uploaded on all servers simultaneously and in parallel. Second task executes only on servers from group `app` (`1.2.3.5` and `1.2.3.6`) in parallel. For second task defined execution timeouts (15 seconds).

Sometimes you have to execute different tasks in parallel. For this case `Dplr` has multithread mode.

```
$dplr
    ->command('app build')
    ->multi()
        ->command('app init --mode=job', 'job')
        ->command('app init --mode=app', 'front')
    ->end()
    ->command('app run', 'front')
;
```

In example above command `app build` will be executed on all servers. After that commands `app init --mode=job` and `app init --mode=app` will be executed on the servers of groups `job` and `front` in parallel. At the end command `app run` will be executed on the servers of group `front`.

### Running

[](#running)

Running is simple:

```
$dplr->run();
```

Define callback if you want to show steps of execution:

```
$dplr->run(function($step) {
    echo $step;
});

/*
    Output
    --
    CPY /home/webmaster/test/share/parameters.yml -> /home/webmaster/project/app/config/parameters.yml ..T.
    CMD cd /home/webmaster/project && ./app/console doctrine:migration:migrate --env=prod --no-debug .E
*/
```

Each dot at the end of task lines means executing of the one action (upload, command) on the certain server. Mark `E` is indicator of failed executing. Mark `J` is indicator of json parsing error. Mark `T` is indicator of executing timeout.

### Result processing

[](#result-processing)

You can get the execution review or detail information about each task execution.

Display report:

```
$report = $dplr->getReport();
echo sprintf(
    "Tasks: %s total, %s successful, %s failed.\nTime of execution: %s\n",
    $report['total'],
    $report['successful'],
    $report['failed'],
    $report['timers']['execution']
);

/*
    Output
    --
    Tasks: 163 total, 163 successful, 0 failed.
    Time of execution: 08:25
*/
```

Detail information about each task:

```
foreach($dplr->getReports() as $report) {
    echo sprintf(
        "%s\n    Successful: %s\n",
        (string) $report,
        $report->isSuccessful() ? 'true' : 'false'
    );
}

/*
    Output
    --
    CPY /home/webmaster/test/share/parameters.yml -> /home/webmaster/project/app/config/parameters.yml | 54.194.27.92
        Successful: false
    CMD cd /home/webmaster/project && ./app/console doctrine:migration:migrate --env=prod --no-debug | 54.194.27.92
        Successful: true
*/
```

Each element in arrays returned by `$dplr->getFailed()` and `$dplr->getReports()` is instance of `Dplr\TaskReport` and has methods:

- `isSuccessful()` - task executing is successful
- `getHost()` - server where task executed
- `getTask()` - information about task (instance of `Dplr\Task`)
- `getOutput()` - output of task
- `getErrorOutput()` - output of error task

Tests
-----

[](#tests)

Execute the commands below to run the tests.

```
make sshkeygen
docker-compose up -d
make composer
make check
```

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance55

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 87.9% 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 ~248 days

Recently: every ~348 days

Total

18

Last Release

299d ago

Major Versions

v0.1.1 → v1.02016-12-30

v1.0.4 → v2.0.02019-06-03

v2.0.2 → v3.0.02020-02-20

PHP version history (4 changes)v1.0PHP &gt;=5.4

v2.0.0PHP &gt;=7.1

v3.0.0PHP &gt;=7.3

v3.2.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d384046cee70e3b28ba79669db1a244f4ff8e87aacb2094180170cba52333e95?d=identicon)[muxx](/maintainers/muxx)

---

Top Contributors

[![muxx](https://avatars.githubusercontent.com/u/461614?v=4)](https://github.com/muxx "muxx (58 commits)")[![akuzia](https://avatars.githubusercontent.com/u/11508654?v=4)](https://github.com/akuzia "akuzia (8 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/muxx-dplr/health.svg)

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

###  Alternatives

[widop/google-analytics-bundle

Google certificate-based authentication in server-to-server interactions with google analytics

43283.2k](/packages/widop-google-analytics-bundle)[in2code/in2publish_core

Content publishing extension to connect stage and production server

40143.4k](/packages/in2code-in2publish-core)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4778.9k](/packages/tiamo-phpas2)[wapmorgan/php-rpm-packager

RPM packager for PHP applications.

106.6k](/packages/wapmorgan-php-rpm-packager)

PHPackages © 2026

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