定制 decodelabs/deliverance 二次开发

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

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

decodelabs/deliverance

最新稳定版本:v0.3.4

Composer 安装命令:

composer require decodelabs/deliverance

包简介

Shared data transfer interfaces

关键字:

README 文档

README

PHP from Packagist Latest Version Total Downloads GitHub Workflow Status PHPStan License

Shared data transfer interfaces for PHP

Deliverance is a middleware library intended to be used by other framework systems that need to manage multiplex IO operations.

Installation

This package requires PHP 8.4 or higher.

Install via Composer:

composer require decodelabs/deliverance

Usage

Channels

Channels represent simple in / out handlers and can be written to and read from:

use DecodeLabs\Deliverance;

$stream = Deliverance::openStream('path/to/file');
$stream->writeLine('Hello world');

$stream = Deliverance::openCliOutputStream(); // Same as new Deliverance\Channel\Stream(STDOUT);

$buffer = Deliverance::newBuffer();
$buffer->write('Some text to buffer');
echo $buffer->read(6); // "Some t"

IO Broker

Channels can be grouped together and managed by an IO Broker -

use DecodeLabs\Deliverance;

// Create a CLI IO handler
$broker = Deliverance::newBroker()
    ->addInputProvider(Deliverance::openStream(STDIN))
    ->addOutputReceiver(Deliverance::openStream(STDOUT))
    ->addErrorReceiver(Deliverance::openStream(STDERR));

// Shortcut to the above:
$broker = Deliverance::newCliBroker();


// Read line from CLI
$broker->readBlocking = true;
$text = $broker->readLine();

// Write it back to output
$broker->writeLine('INPUT: '.$text);

Once grouped, the Channels in an IO broker can be used as the interface between many different information sources; see Systemic Unix process launcher for an example of an IO Broker managing input and output with proc_open().

Licensing

Deliverance is licensed under the MIT License. See LICENSE for the full license text.

统计信息

  • 总下载量: 27.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固