承接 mateuszanella/php-ext-xz 相关项目开发

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

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

mateuszanella/php-ext-xz

最新稳定版本:v1.2.0

Composer 安装命令:

pie install mateuszanella/php-ext-xz

包简介

A PHP Extension providing xz (LZMA2) compression/decompression via PHP streams.

README 文档

README

PHP Extension providing XZ (LZMA2) compression/decompression functions.

Installation

The recommended way to install the extension is using pie:

pie install mateuszanella/php-ext-xz

This will download the source and compile the extension for your current PHP version. After installing the module, you may need to enable it in your php.ini file.

Configuration

php.ini

Add the following line to your php.ini configuration file:

extension=xz.so

You can also configure the default compression level and memory limit:

; Default compression level. Affects `xzencode` and `xzopen`, 
; but only when the level was not specified. Default is 5.
xz.compression_level=5

; The maximum amount of memory that can be used when decompressing. Default is 0 (no limit).
xz.max_memory=65536

Build from Source

For detailed build and installation instructions from source, please see docs/BUILD.md.

Basic usage

String-based operations

You can easily compress and decompress strings.

$originalString = 'This is a test string that will be compressed and then decompressed.';

// Compress a string
$compressed = xzencode($originalString);

// Decompress a string
$decompressed = xzdecode($compressed);

File-based operations

The extension also supports stream-based operations for working with .xz files.

$file = '/tmp/test.xz';

// Writing to an .xz file
$wh = xzopen($file, 'w');
xzwrite($wh, 'Data to write');
xzclose($wh);

// Reading from an .xz file and outputting its contents
$rh = xzopen($file, 'r');
xzpassthru($rh);
xzclose($rh);

Credits

This repository is a fork from php-ext-xz by codemasher, originally forked from the RFC.

You can see the full list of contributors here.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 1
  • 开发语言: C

其他信息

  • 授权协议: PHP-3.01
  • 更新时间: 2025-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固