Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjdev/php-ext-bzip3
Bzip3 Extension for PHP
https://github.com/kjdev/php-ext-bzip3
Last synced: 25 days ago
JSON representation
Bzip3 Extension for PHP
- Host: GitHub
- URL: https://github.com/kjdev/php-ext-bzip3
- Owner: kjdev
- Created: 2022-05-17T03:33:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-07T00:23:20.000Z (about 1 year ago)
- Last Synced: 2024-11-18T00:52:33.475Z (about 2 months ago)
- Language: C
- Size: 35.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bzip3 Extension for PHP
This extension allows [bzip3](https://github.com/kspalaiologos/bzip3).
## Build
``` sh
% git clone --recursive --depth=1 https://github.com/kjdev/php-ext-bzip3.git
% cd php-ext-bzip3
% phpize
% ./configure
% make
$ make install
```To use the system library.
``` sh
% ./configure --with-libbzip3
```## Configuration
php.ini:
``` sh
extension=bzip3.so
```## Usage
``` php
$compress = Bzip3\compress($data);
$var = Bzip3\uncompress($compress);
```## Function synopsis
``` php
Bzip3\comporess(string $data, int $block_size = 8): string|false
Bzip3\uncomporess(string $data): string|false
```---
### Bzip3\compress
``` php
Bzip3\compress(string $data, int $block_size = 8): string|false
```This function compress a string.
**Parameters:**
* data
The data to compress.
* block_size
compress block size in MiB. (Defaults to 8)
**Return Values:**
The compressed string or FALSE if an error occurred.
---
### Bzip3\uncompress
``` php
Bzip3\uncompress(string $data): string|false
```This function uncompress a compressed string.
**Parameters:**
* data
The data compressed by Bzip3\compress().
**Return Values:**
The original uncompressed data or FALSE on error.