Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/workflows/ | H | 15-Jan-2021 | - | 334 | 276 | |
snappy/ | H | 15-Jan-2021 | - | |||
tests/ | H | 15-Jan-2021 | - | 663 | 555 | |
.gitignore | H A D | 15-Jan-2021 | 265 | 26 | 25 | |
.gitmodules | H A D | 15-Jan-2021 | 80 | 4 | 3 | |
COPYING.snappy | H A D | 15-Jan-2021 | 2.6 KiB | 55 | 45 | |
CREDITS | H A D | 15-Jan-2021 | 7 | 2 | 1 | |
LICENSE | H A D | 15-Jan-2021 | 3.1 KiB | 69 | 55 | |
README.md | H A D | 15-Jan-2021 | 1.9 KiB | 84 | 48 | |
config.m4 | H A D | 15-Jan-2021 | 5.4 KiB | 182 | 157 | |
config.w32 | H A D | 15-Jan-2021 | 775 | 15 | 13 | |
php_snappy.h | H A D | 15-Jan-2021 | 842 | 44 | 33 | |
snappy.c | H A D | 15-Jan-2021 | 6.7 KiB | 273 | 227 |
README.md
1# Snappy Extension for PHP 2 3[![Linux](https://github.com/kjdev/php-ext-snappy/workflows/Linux/badge.svg?branch=master)](https://github.com/kjdev/php-ext-snappy/actions?query=workflow%3ALinux+branch%3Amaster) 4[![Windows](https://github.com/kjdev/php-ext-snappy/workflows/Windows/badge.svg?branch=master)](https://github.com/kjdev/php-ext-snappy/actions?query=workflow%3AWindows+branch%3Amaster) 5 6This extension allows Snappy. 7 8Documentation for Snappy can be found at 9[» http://google.github.io/snappy/](http://google.github.io/snappy/). 10 11## Build from sources 12 13 % git clone --recursive --depth=1 https://github.com/kjdev/php-ext-snappy.git 14 % cd php-ext-snappy 15 % phpize 16 % ./configure 17 % make 18 % make install 19 20To use the system library 21 22``` bash 23% ./configure --with-snappy-includedir=/usr 24``` 25 26## Distribution binary packages 27 28### Fedora / CentOS / RHEL 29 30RPM packages of this extension are available in [» Remi's RPM repository](https://rpms.remirepo.net/) and are named **php-snappy**. 31 32## Configuration 33 34php.ini: 35 36 extension=snappy.so 37 38## Function : snappy_compress 39 40string snappy_compress( string $data ) 41 42### parameters 43 44data: 45 46 The data to compress. 47 48### return values 49 50The compressed string or FALSE if an error occurred. 51 52## Function : snappy_uncompress 53 54string snappy_uncompress( string $data ) 55 56### parameters 57 58name: 59 60 The data compressed by snappy_gzcompress(). 61 62### return values 63 64The original uncompressed data or FALSE on error. 65 66## Example 67 68 $compressed = snappy_compress('Compress me'); 69 70 $uncompressed = snappy_uncompress($compressed); 71 72 echo $uncompressed; 73 74## Ubuntu Tipps 75 76snappy requires C++ and therefore might require for you to install the g++ or build-essential package. 77 78If you get an error about "this file requires compiler and library support" you might need to enfore the compilation with 79 80 $ export CXXFLAGS=-std=c++11 81 $ phpize 82 $ ./configure 83 $ make 84