PHPackages                             pixelbrackets/pap - 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. pixelbrackets/pap

ActiveLibrary

pixelbrackets/pap
=================

PHP App Publication

9.3.0(2mo ago)13.4k—0%1GPL-2.0-or-laterPHPPHP ^7.2 || ^8.0

Since Aug 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/pixelbrackets/pap)[ Packagist](https://packagist.org/packages/pixelbrackets/pap)[ RSS](/packages/pixelbrackets-pap/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (13)Used By (1)

PAP
===

[](#pap)

[![Logo](./docs/icon.png)](./docs/icon.png)

**P**HP **A**pp **P**ublication

[![Version](https://camo.githubusercontent.com/a4dc932091c1c1e857b883ffb1b1e15c7ef50bcb89bba319ccee058b4426be0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706978656c627261636b6574732f7061702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pixelbrackets/pap/)[![Build Status](https://camo.githubusercontent.com/8450b12445dae20fdd6db6ae930972632f5911af007d84678ab2c27a034b9c2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746c61622f706970656c696e652f706978656c627261636b6574732f7061703f7374796c653d666c61742d737175617265)](https://gitlab.com/pixelbrackets/pap/pipelines)[![Made With](https://camo.githubusercontent.com/f6c764778c46107383a50b589db66c3cdd5827e7414d138214e41a57ac94df33/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6164655f776974682d7068702d626c75653f7374796c653d666c61742d737175617265)](https://gitlab.com/pixelbrackets/pap#requirements)[![License](https://camo.githubusercontent.com/4daac00aaa49d8045d90fc294ffbcc993557bc747e009ca9b1e0bb5271dafa7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d67706c2d2d322e302d2d6f722d2d6c617465722d626c75652e7376673f7374796c653d666c61742d737175617265)](https://spdx.org/licenses/GPL-2.0-or-later.html)[![Contribution](https://camo.githubusercontent.com/77413ebb58209400e902c9d15548bdc24f149749d4122a0216c6af44a91d4a42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e735f77656c636f6d652d2546302539462539342542302d627269676874677265656e2e7376673f6c6162656c436f6c6f723d627269676874677265656e267374796c653d666c61742d737175617265)](https://gitlab.com/pixelbrackets/pap/-/blob/master/CONTRIBUTING.md)

Toolchain to publish a PHP App. One YAML file. One command set. Any project.

**⚡ Same commands in every project** - Learn once, use everywhere. No need to memorize different deployment steps for each project.

**📝 One YAML file** - All deployment configuration in one place. No scattered scripts, no complex build tools.

**🚀 15 minute setup** - Add PAP to any project in minutes. No coupling with your app code, works as standalone build directory.

**👥 Team and CI-friendly** - New teammates and CI robots can deploy without understanding the internals. Just one command: `pap publish`.

[![Screenshot](./docs/screenshot.png)](./docs/screenshot.png)

What it does
------------

[](#what-it-does)

- Build Assets - Minify &amp; concat CSS, JavaScript, SVG assets
- Build App - Prepare expected directory structures &amp; fetch packages
- Lint - Identify errors before the app is running
- Unit Test - Run unit tests against local code
- Deploy - Sync files to configurable target stages (local, test, live, …)
- Verify - Do a smoke test to verify that the app is still working
- Test - Run integration tests against deployed app

Design Principles
-----------------

[](#design-principles)

**KISS approach** - Not made for every condition, but easy to use and integrate

- Fixed set of task commands (but you can run custom scripts within them)
- YAML configuration with local overrides support
- Works as standalone build directory (no coupling with app code)
- CI/CD friendly - same commands work for humans and robots
- Minimal requirements: Git, PHP, Composer, rsync, SSH
- Multiple deployment stages (local, test, live, …)
- Monorepo support
- No rollback (use Git to revert changes)
- No provisioning (deploy only)

When to use alternatives: Need custom task workflows, atomic releases, advanced rollback strategies, or server provisioning? Tools like [Deployer](https://deployer.org/), [Capistrano](https://capistranorb.com/), or [Ansible](https://www.ansible.com/) offer more features. PAPs sweet spot is that it is *deliberately* simple - perfect for small to medium projects where complexity isn't worth the overhead.

Requirements
------------

[](#requirements)

- cURL, SSH &amp; rsync
- Git
- PHP
- Composer
- SSH-Account on target stage(s) with read &amp; write access, and right to run cURL, rsync and PHP

Source
------

[](#source)

Mirror  (Issues &amp; Pull Requests mirrored to GitLab)

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

[](#installation)

### New Projects

[](#new-projects)

The recommend way to add PAP to a new project is to use the provided [skeleton package](https://github.com/pixelbrackets/pap-skeleton). This creates a `build/` directory with all required configuration files and the PAP executable in one command.

```
composer create-project pixelbrackets/pap-skeleton build
cd build
./vendor/bin/pap list
```

Now edit `pap.yml` to configure your deployment stages.

Alternatively, add PAP to an existing directory and use the built-in init wizard to generate configuration files interactively:

```
composer require pixelbrackets/pap
./vendor/bin/pap init
```

The wizard asks for stage name, SSH credentials, sync paths and more, then generates the according `pap.yml` file.

**📚 New to PAP?** Follow the [step-by-step walkthrough tutorial](./docs/walktrough.md) to learn how to set up PAP and publish your PHP webapp or website (~15 minutes).

### Existing Projects

[](#existing-projects)

If your project already has a `build/` directory with PAP configuration files, then all you need to do is fetching PAP using Composer, no additional setup required.

```
cd build
composer install
./vendor/bin/pap list
```

### Global Installation (Advanced)

[](#global-installation-advanced)

For special use cases like global installation, team consistency, or CI environments, you can install PAP as a phar executable or self-contained binary.

Distribution repository:

**Binary** (Linux):

```
wget https://github.com/pixelbrackets/pap-dist/releases/latest/download/pap-linux-x64
sudo mv pap-linux-x64 /usr/local/bin/pap
sudo chmod +x /usr/local/bin/pap
pap list
```

The binary bundles a specific PHP version, so it works independent of your projects PHP version. **Security Note:** The bundled PHP version may lag behind security updates. For production deployments within public CI workflows, prefer the standard Composer installation to control PHP updates via system updates.

**PHAR** (all platforms):

```
wget https://github.com/pixelbrackets/pap-dist/releases/latest/download/pap.phar
php pap.phar list
```

### CI/CD Usage

[](#cicd-usage)

**GitLab CI example:**

```
deploy:
  stage: deploy
  image: composer:latest
  script:
    - cd build && composer install  # Installs PAP via Composer
    - vendor/bin/pap deploy live # Deploy app to live stage using the versioned configuration files
```

**GitHub Actions example:**

```
- name: Install dependencies
  run: cd build && composer install

- name: Deploy
  run: cd build && vendor/bin/pap deploy live
```

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

[](#configuration)

PAP is configured with YAML files:

- **`pap.yml`** - Shared settings and stages (committed to Git)
- **`pap.local.yml`** - Local overrides (add to `.gitignore`)

**The skeleton package provides these files as templates.** Just edit `pap.yml` to configure:

- Deployment stages (local, test, live)
- Sync paths (which files to deploy)
- Build tasks (assets, dependencies)
- Lint and test commands

All configuration paths are relative to your Git repository root, so you can place the configuration in any subdirectory (typically `build/`) and are still good to go.

- 📖 [Walkthrough: Publish your first app](./docs/walktrough.md) - Complete beginner guide with example app (15 min)
- 📝 [Reference: All available configuration options](./docs/configuration.md)
- 🛠️ [Tutorial: Manual setup without skeleton package](./docs/configuration.md#manual-setup) (advanced)

Updates
-------

[](#updates)

See [Upgrade Guide](./docs/upgrade-guide.md)

Usage
-----

[](#usage)

This section gives a brief overview of available commands and common tasks.

**Quick Tips:**

- Run `./vendor/bin/pap` to see all available tasks
- Add `--help` to each task command to see all available options
- Add `--simulate` to each task command to run in dry-mode first
- Most tasks have a stage as target, passed as argument (eg. `deploy live`) or with `--stage `
    - If no stagename is passed, the name "local" is used as default - use this for development on your local machine

Somme common tasks are:

**Deploy to live stage:**

```
./vendor/bin/pap deploy live
```

**Deploy to local stage (default, for development):**

```
./vendor/bin/pap deploy
```

**Sync files without building assets:**

```
./vendor/bin/pap sync
```

**Watch and auto-sync on file changes:**

```
./vendor/bin/pap watch              # Defaults to local stage
./vendor/bin/pap watch live         # Watch and sync to live stage
```

**Lint files:**

```
./vendor/bin/pap lint
```

**SSH:**

```
./vendor/bin/pap ssh test                    # Open interactive shell on test stage
./vendor/bin/pap ssh:exec test "php -v"      # Execute single command
```

**Examine:**

```
./vendor/bin/pap view live # Opens the live stage URL in default browser
```

**Verify:**

```
./vendor/bin/pap show stages # Show all configured stages and their details
```

### Commands

[](#commands)

**Task Hierarchy** - Understanding the full publication stack:

```
publish (Complete release workflow)
├── lint (Validate code syntax)
├── test:unit (Run unit tests against local code)
├── deploy (Full deployment)
│   ├── build (Prepare application)
│   │   ├── buildassets (Process CSS/JS/images)
│   │   └── buildapp (Prepare directory structure and install composer dependencies locally)
│   ├── sync (Transfer files via rsync)
│   └── composer:install (Install remaining dependencies and trigger post-install commands on target stage)
├── test:smoke (Quick HTTP check)
└── test:integration (Run integration tests against deployed app)

Common standalone tasks:
├── init (Generate configuration interactively)
├── show stages (Get a list of all configured stages)
├── sync (Quick file sync without rebuilding)
├── watch (Auto-sync on file changes)
├── lint:fix (Auto-fix code style issues)
├── ssh:connect (SSH into stage)
├── ssh:exec (Execute command on stage)
└── view (Open stage URL in browser)

```

**All Available Commands:**

```
build             Alias to run »buildassets« and »buildapp«
buildapp          Build PHP structure for desired target stage (move files, fetch dependencies)
buildassets       Build HTML assets (convert, concat, minify…)
composer:command  Execute Composer command in working directory on target stage
composer:install  Install packages with Composer
deploy            Run full deployment stack (build, sync, composer command)
help              Display help for a command
init              Generate configuration interactively
lint              Alias to run »lint:check«
lint:check        Lint files (Check only)
lint:fix          Lint files (Fix)
list              List commands
publish           Run full publication stack (lint, test:unit, deploy, test:smoke, test:integration)
show              Pretty print configuration for debugging
ssh               Alias to run »ssh:connect«
ssh:connect       Open SSH connection to target stage
ssh:exec          Execute command in working directory on target stage via SSH
sync              Synchronize files to target stage
test              Alias to run »test:integration«
test:integration  Run integration tests against target stage
test:smoke        Run a build verification test against target stage
test:unit         Run unit tests against local code
view              Open the public URL of target stage in the browser
watch             Sync changed files automatically to target stage

```

License
-------

[](#license)

GNU General Public License version 2 or later

The GNU General Public License can be found at .

Author
------

[](#author)

Dan Kleine ( / [@pixelbrackets](https://pixelbrackets.de))

Changelog
---------

[](#changelog)

See [CHANGELOG.md](./CHANGELOG.md)

Contribution
------------

[](#contribution)

This script is Open Source, so please use, share, patch, extend or fork it.

[Contributions](./CONTRIBUTING.md) are welcome!

Feedback
--------

[](#feedback)

Please send some [feedback](https://pixelbrackets.de/) and share how this package has proven useful to you or how you may help to improve it.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance83

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community9

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

Recently: every ~387 days

Total

11

Last Release

89d ago

Major Versions

7.2.0 → 8.0.02020-12-22

7.2.1 → 8.0.12021-08-04

8.1.0 → 9.0.02021-11-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ca67c6c7d79cf33bb5688dcbf217ad52309a52580b6a490aae8445f446178a3?d=identicon)[pixelbrackets](/maintainers/pixelbrackets)

---

Top Contributors

[![pixelbrackets](https://avatars.githubusercontent.com/u/1592995?v=4)](https://github.com/pixelbrackets "pixelbrackets (201 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pixelbrackets-pap/health.svg)

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

###  Alternatives

[drush/drush

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2.4k57.4M685](/packages/drush-drush)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M13](/packages/pantheon-systems-terminus)[civicrm/civicrm-core

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

728272.9k20](/packages/civicrm-civicrm-core)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[chromatic/usher

A collection of Robo commands for use on Chromatic projects.

13534.3k1](/packages/chromatic-usher)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

38244.6k16](/packages/ec-europa-toolkit)

PHPackages © 2026

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