定制 codelayer/bubblewrap 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codelayer/bubblewrap

Composer 安装命令:

composer require codelayer/bubblewrap

包简介

Sandbox console commands using bubblewrap

README 文档

README

License: MIT Packagist Version

A PHP wrapper class for the 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

The package can be installed using composer:

$ composer require codelayer/bubblewrap

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 object.

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

This package is licensed under the MIT License. For more information see the LICENSE file.

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.

统计信息

  • 总下载量: 204
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固