1. Go to this page and download the library: Download belisoful/prado-compression library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
belisoful / prado-compression example snippets
use Prado\IO\Compression\TXzFallbackCompressor;
if (TXzFallbackCompressor::isAvailable()) {
$packed = TXzFallbackCompressor::compress($data);
$data = TXzFallbackCompressor::decompress($packed);
}
use Prado\IO\Compression\TFallbackCompressorMode;
use Prado\IO\Compression\TGzipFallbackCompressor;
TGzipFallbackCompressor::setBackendMode(TFallbackCompressorMode::CliFirst);
TGzipFallbackCompressor::getBackendMode(); // 'CliFirst'
TGzipFallbackCompressor::setBackendMode(null); // restores the default, PhpFirst
TXzFallbackCompressor::setTempDirectory('/var/lib/myapp/tmp');
TXzFallbackCompressor::getTempDirectory(); // the canonical path
TXzFallbackCompressor::setTempDirectory(null); // restores the system directory
class TSystemXzCompressor extends TXzFallbackCompressor
{
protected static function commands(): array
{
return ['/usr/bin/xz'];
}
}