PHPackages                             codelayer/bubblewrap - 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. codelayer/bubblewrap

ActiveLibrary

codelayer/bubblewrap
====================

Sandbox console commands using bubblewrap

v1.5.0(3y ago)4204MITPHP

Since Dec 13Pushed 3y ago3 watchersCompare

[ Source](https://github.com/codelayerhq/bubblewrap-php)[ Packagist](https://packagist.org/packages/codelayer/bubblewrap)[ RSS](/packages/codelayer-bubblewrap/feed)WikiDiscussions master Synced 1w ago

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

PHP Bubblewrap
==============

[](#php-bubblewrap)

[![](https://github.com/codelayerhq/bubblewrap-php/workflows/PHP%20Composer/badge.svg)](https://github.com/codelayerhq/bubblewrap-php/workflows/PHP%20Composer/badge.svg)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Packagist Version](https://camo.githubusercontent.com/9b80b018aa227bdf5cf3d20fc2fa02363c0e8e783d818dd1699ddccdb4604d99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656c617965722f627562626c6577726170)](https://camo.githubusercontent.com/9b80b018aa227bdf5cf3d20fc2fa02363c0e8e783d818dd1699ddccdb4604d99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656c617965722f627562626c6577726170)

A PHP wrapper class for the [bubblewrap](https://github.com/containers/bubblewrap) cli tool. Can be used to execute external commands like imagemagick or ghostscript in a separated environment as a protection against possible security issues.

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

[](#installation)

The package can be installed using composer:

```
$ composer require codelayer/bubblewrap

```

Usage
-----

[](#usage)

At the moment most commands that don't take a file descriptor as argument are implemented. This snippet shows how the example from the bubblewrap readme looks in PHP:

```
$bwrap = new \Codelayer\Bubblewrap\Bubblewrap();

$bwrap
    ->readOnlyBind('/usr') // If src equals dest only one parameter is required for bind commands
    ->symlink('usr/lib64', '/lib')
    ->proc() // /proc is used as default location for procfs
    ->dev()  // /dev  is used as default location for devtmpfs
    ->unsharePid()
    ->exec(['bash']);
```

Exec returns a [Symfony Process](https://symfony.com/doc/current/components/process.html) object.

Additional methods
------------------

[](#additional-methods)

Two additional methods are available to modify how bubblewrap is called:

- `setBinary($binary)` sets the location of the bwrap binary
- `clearEnv()` prepends `env -i` to the bwrap calls and unsets all environment variables
- `getCommand($cmd)` show the full command that `exec($cmd)` would execute

License
-------

[](#license)

This package is licensed under the MIT License. For more information see the [LICENSE file](./LICENSE).

About us
--------

[](#about-us)

codelayer is a software company from Karlsruhe, Germany which specializes in web application development.
For more information about codelayer, visit our website at [codelayer.de](https://codelayer.de).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Recently: every ~139 days

Total

7

Last Release

1426d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f04d4e2cb7a74a716a094852915a387214f7f303914284c3655f9a060ed9efc?d=identicon)[codelayer](/maintainers/codelayer)

---

Top Contributors

[![mawalu](https://avatars.githubusercontent.com/u/2027387?v=4)](https://github.com/mawalu "mawalu (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codelayer-bubblewrap/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[illuminate/process

The Illuminate Process package.

44699.5k65](/packages/illuminate-process)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)

PHPackages © 2026

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