trilations / html-to-binary
此包最新版本(3.0.1)没有可用的许可证信息。
使用基于Docker的puppeteer服务器将HTML导出为jpeg/png或PDF
3.0.1
2022-11-09 08:39 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- psr/http-client: 1.0.1
- psr/http-factory: 1.0.1
Requires (Dev)
- phpcompatibility/php-compatibility: ^9.3
- phpro/grumphp-shim: ^1.13
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3.7
README
安装
将其添加到您的 composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://gitlab.com/trilations/html-to-binary.git"
},
],
"require": {
"trilations/html-to-binary": "^2.4.0"
}
}
并运行 composer update
composer update
使用方法
贡献
安装
# make sure you have php 7.4 or higher
php -v
# make sure you have composer installed
composer -v
# clone the repository
git clone git@gitlab.com:trilations/html-to-binary.git
# cd into the directory
cd html-to-binary
# install dependencies
composer install
编码标准
检查并修复违反编码标准的问题
# run phpcs on the code (checks violations)
./vendor/bin/phpcs
# run phpcbf (fixes violations)
./vendor/bin/phpcbf
# add all warnings to the output
./vendor/bin/phpcs --warning-severity=1
此外,您应定期检查与支持的PHP版本的任何不兼容性
# Runs the sniffer script as defined in composer.json
composer sniffer:php7.4
composer sniffer:php8.0
composer sniffer:php8.1
# Any other version can be checked like this
composer sniffer:php 7.1
测试
PHPUnit
# running all tests
./vendor/bin/phpunit
# checking the code coverage (requires Xdebug)
./vendor/bin/phpunit --coverage-text
./vendor/bin/phpunit --coverage-html coverage.html # generate html report
# you might need to prefix these commands with XDEBUG_MODE=coverage
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text