Skip to content

kjdev/php-ext-snappy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
December 13, 2022 06:45
December 11, 2020 11:43
July 27, 2012 17:24
July 27, 2012 17:24
July 27, 2012 17:24
August 15, 2021 16:07
October 2, 2020 12:44
January 15, 2021 11:28
January 15, 2021 11:21
May 27, 2022 10:16

Snappy Extension for PHP

Linux Windows

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

php.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_compress(). 

return values

The original uncompressed data or FALSE on error.

Example

$compressed = snappy_compress('Compress me');

$uncompressed = snappy_uncompress($compressed);

echo $uncompressed;

Ubuntu Tipps

snappy requires C++ and therefore might require for you to install the g++ or build-essential package.

If you get an error about "this file requires compiler and library support" you might need to enfore the compilation with

$ export CXXFLAGS=-std=c++11
$ phpize
$ ./configure
$ make

About

Snappy Extension for PHP

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
COPYING.snappy

Stars

Watchers

Forks

Packages

No packages published