gtuk/php-lepton

Dropbox Lepton 压缩工具的 PHP 封装库

1.0 2016-07-24 17:54 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:14:45 UTC


README

Dropbox Lepton 压缩工具的 PHP 封装库。

本指南假设您已安装 Dropbox Lepton。

安装

您可以使用 composer 安装此库,或者将其手动包含到您的项目中。

快速开始

 $lepton = new Lepton('<LeptonPath>');

在此之后,您可以运行压缩或解压缩命令之一。如果压缩或解压缩失败,Lepton 将抛出异常,否则返回 TRUE。

$options = array(
);

$result = $lepton->compress(
    'example.jpg',
    'example.lep',
    $options
);

$result = $lepton->decompress(
    'example.lep',
    'example.jpg',
    $options
);

##可用选项

$options = array(
 '-unjailed',
 '-singlethread',
 '-maxchildren',
 '-preload',
 '-unkillable',
 '-allowprogressive',
 '-zlib0',
 '-timebound=<>ms',
 '-trunc=<>',
 '-memory=<>M',
 '-threadmemory=<>M',
 '-hugepages',
 '-avx2upgrade',
 '-injectsyscall={1..4}',
 '-socket',
 '-socket=<name>',
 '-listen',
 '-listen=<port>',
 '-zliblisten',
 '-zliblisten=<port>',
 '-recodememory=<>M'
);