robopuff / tinypng
PHP的Modern TinyPNG客户端
v1.0.1
2022-04-05 09:52 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- psr/cache: ^3.0
- psr/http-message: ^1.0
- psr/log: ^1.1
Requires (Dev)
- paragonie/certainty: ^2.8
- phan/phan: ^4.0
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^0.12
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2024-09-16 13:46:40 UTC
README
TinyPNG API的PHP客户端
PHP版本的TinyPNG API客户端,更多信息请参阅官方TinyPNG文档。
使用MKDocs生成文档
安装
composer require robopuff/tinypng
用法
$tinyPng = new \TinyPng\TinyPng(new \TinyPng\Client\GuzzleClient('your_api_key')); $tinyPng ->optimize(new \TinyPng\Input\Filesystem('unoptimized_image.png')) ->store(new \TinyPng\Output\Storage\Filesystem('optimized_image.png'));
运行测试
composer test-suite
集成测试
TINYPNG_KEY=$YOUR_API_KEY composer test-integration
许可证
本软件遵循BSD-3-Clause许可证。 查看许可证。