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
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-07