kcs/compressor-bundle
Composer 安装命令:
composer require kcs/compressor-bundle
包简介
Html compressor and optimizer bundle
README 文档
README
Requirements:
- Symfony 2 (>= 2.2)
Installation:
- Include this bundle in your composer.json
$ php composer.phar require kcs/compressor-bundle dev-master
Enable the bundle in your AppKernel.php
<?php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
...
new Kcs\CompressorBundle\KcsCompressorBundle(),
...
);
...
}
}
Configuration
You can enable or disable preservers and compressors changing one of these flags in your config.yml
kcs_compressor: enabled: true # Set to false to disable the compressor compress_html: true # Enable HTML optimizations preserve_line_breaks: true # Enable the line breaks preservation remove_comments: true # Remove HTML comments while compressing remove_extra_spaces: true # Remove extra spaces in HTML compress_js: true # Enable inline js compression compress_css: true # Enable inline css compression
If inline js (or css) compression is enabled you must specify the compressor to be used:
kcs_compressor: js_compressor: none # Can be none (disabled), yui or custom css_compressor: none # Can be none (disabled), yui or custom
You can specify a custom class for the inline js and css compressors.
Use the js_compressor_class and the css_compressor_class setting to specify which classes must be used.
The custom inline compressor class must implement the Kcs\CompressorBundle\Compressor\InlineCompressorInterface interface and export a compress public function accepting the uncompressed content as argument and returning the compressed block
YUI compressor
If the yui compressor is used the YUI jar file location must be specified in the yui_jar setting. You can also change the java executable path modifying the java_path setting. If not specified defaults to /usr/bin/java.
kcs/compressor-bundle 适用场景与选型建议
kcs/compressor-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 45.01k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 05 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kcs/compressor-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kcs/compressor-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 45.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-15