jackwqg / php-ext-snappy

Snappy Extension for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snappy Extension for PHP

Build Status

This extension allows Snappy.

Documentation for Snappy can be found at » http://google.github.io/snappy/.

Build from sources

% git clone --recursive --depth=1 https://github.com/kjdev/php-ext-snappy.git
% cd php-ext-snappy
% phpize
% ./configure
% make
% make install

To use the system library

% ./configure --with-snappy-includedir=/usr

Distribution binary packages

Fedora / CentOS / RHEL

RPM packages of this extension are available in » Remi's RPM repository and are named php-snappy.

Configuration

snappy.ini:

extension=snappy.so

Function : snappy_compress

string snappy_compress( string $data )

parameters

data:

The data to compress.

return values

The compressed string or FALSE if an error occurred.

Function : snappy_uncompress

string snappy_uncompress( string $data )

parameters

name:

The data compressed by snappy_gzcompress(). 

return values

The original uncompressed data or FALSE on error.

Example

$compressed = snappy_compress('Compress me');

$uncompressed = snappy_uncompress($compressed);

echo $uncompressed;

About

Snappy Extension for PHP

License:Other


Languages

Language:PHP 48.7%Language:M4 27.6%Language:C 23.8%