承接 msst/byte-buffer 相关项目开发

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

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

msst/byte-buffer

Composer 安装命令:

composer require msst/byte-buffer

包简介

A wrapper for the PHP pack() function. Simple handling of bytes in PHP (original by Ole 'nesQuick' Michaelis)

README 文档

README

Build Status

This is a improved rewrite of the Project from OleMchls You can also call this a pack() wrapper.

Additional Features

  • Autoincrement Offset
  • Write Int32, Int64, UInt64 and UTF8 Strings

Install

Installation should be done via composer.

composer require msst/byte-buffer

Or

{
    "require": {
        "msst/byte-buffer": "dev-master"
    }
}

Example

A simple usage example could look like this

<?php

require __DIR__ . '/vendor/autoload.php';

use MSST\ByteBuffer\Buffer;

$text1 = 'channel_one';
$text2 = "This is a utf8 test message. 😄";

$buffer = new Buffer(4 + 1 + 4 + strlen($text1) + strlen($text2));
$buffer->writeInt32($buffer->length());
$buffer->writeInt8(0x1);
$buffer->writeInt32(strlen($text1));
$buffer->write($text1);
$buffer->writeUtf8($text2);

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_connect($socket, '127.0.0.1', 3542);

socket_write($socket, (string) $buffer, $buffer->length());

Testing

Just working under php > 7.1

./vendor/bin/phpunit

License

Licensed under the MIT license.

Original Project: ByteBuffer by OleMchls

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固