Skip to content
This repository has been archived by the owner on Jan 13, 2019. It is now read-only.

Latest commit

 

History

History
39 lines (26 loc) · 909 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 909 Bytes

php-xz

Build Status

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

Installation

To install as module, perform the following steps:

git clone https://github.com/udan11/php-xz
cd php-xz && phpize && ./configure && make && sudo make install

Do not forget to add extension = xz.so to your php.ini.

Requirements

This module depends on git, php5-dev and liblzma-dev. If you are using Ubuntu, you can easily install all of them by typing the following command in your terminal:

sudo apt-get install git php5-dev liblzma-dev

Basic usage

<?php

$fh = xzopen("/tmp/test.xz", "w");
xzwrite($fh, "Data you would like compressed and written.\n");
xzclose($fh);

$fh = xzopen("/tmp/test.xz", "r");
xzpassthru($fh);
xzclose($fh);