定制 konstantin-kuklin/stream-library 二次开发

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

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

konstantin-kuklin/stream-library

Composer 安装命令:

composer require konstantin-kuklin/stream-library

包简介

Wrapper for stream functions

README 文档

README

Build Status Scrutinizer Code Quality Scrutinizer Test Coverage Latest Stable Version Total Downloads

README

What is StreamLibrary?

StreamLibrary is a PHP wrapper via stream functions. It allows to work with streams with more comfortable environment.

Requirements

StreamLibrary is only supported on PHP 5 and up.

Installation

The best way to install StreamLibrary is with composer:

composer.phar require konstantin-kuklin/stream-library:dev-master

Documentation

First step to work is a creating object of Stream:

$stream = new \Stream\Stream($path, $protocol, $port, $driver);

path - Path to file on system or ip address in network or hostname which we will work

protocol - String value of protocol type, can be Connection::PROTOCOL_TCP, Connection::PROTOCOL_UDP, Connection::PROTOCOL_UNIX

port - Integer value of port to connect. Not needs if protocol Connection::PROTOCOL_UNIX. Default value = 0.

driver - Object implements StreamDriverInterface. If your connection need to change transfer data you need to describe it logic with this object. Default value is null(mean data haven't been changed)

Get data from Stream

$stream = new \Stream\Stream($path, $protocol, $port, $driver);
$stream->setReceiveMethod(new StreamGetContentsMethod($maxLength, $offset));
$stream->getContents();

maxLength - The maximum bytes to read. Default value is -1 (read all the remaining buffer)

offset - Seek to the specified offset before reading. Default value is -1 (read without offset)

Send data to Stream

$stream = new \Stream\Stream($path, $protocol, $port, $driver);
$stream->sendContents($contents);

contents - can contain any string data

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固