承接 loandbeholdru/pipe 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

loandbeholdru/pipe

Composer 安装命令:

composer require loandbeholdru/pipe

包简介

Classes to run shell commands trow linux pipe

README 文档

README

It's small and lightweight pack to run shell script throw command pipe (bus). So useful to build webhooks on top of docker-container with shell scripts and link them with REST Api.

You no longer need to learn fancy package configurations for webhooks. Use the usual tools.

Installation

It's recommended that you use Composer to install shorts.

$ composer require loandbeholdru/pipe

Usage

Create pipe on host with php and give rights to read it on host with executing scripts (docker-composer example):

mkfifo /tmp/pipefile

On host/container with shell-scripts run main execution script:

./serve.sh [path_to_pipe] [path_to_reaction_dir]

Create command:

$command = new pipecommand("/tmp/pipefile", "/some/path/script_with_two_params.sh %s %s", $par1, $par2);

Create result trap:

$result = new piperesult("/tmp/pipefile", new brokenPipeException("When pipe not working!"));

Execute your command and get $strings from your shell-script:

$strings = pipe::exec($command, $result, new bashCommandErrorException("When your script return error!"));

Contributions

... are always welcome. Many times it is useful to just point out a use case the author have not thought about or come across.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-07