abbas13375/yii2-assets-auto-compress
Composer 安装命令:
composer require abbas13375/yii2-assets-auto-compress
包简介
Automatically compile and merge files js + css + html in yii2 project
README 文档
README
This solution enables you to dynamically combine js and css files to optimize the html page. This allows you to improve the performance of google page speed.
This tool only works on real sites. On the local projects is not working!
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist abbas13375/yii2-assets-auto-compress "*"
or add
"abbas13375/yii2-assets-auto-compress": "*"
How to use
//App config [ 'bootstrap' => ['assetsAutoCompress'], 'components' => [ //.... 'assetsAutoCompress' => [ 'class' => '\abbas13375\yii2\assetsAuto\AssetsAutoCompressComponent', ], //.... ] ]
//App config with all options [ 'bootstrap' => ['assetsAutoCompress'], 'components' => [ //.... 'assetsAutoCompress' => [ 'class' => '\abbas13375\yii2\assetsAuto\AssetsAutoCompressComponent', 'enabled' => true, 'readFileTimeout' => 3, //Time in seconds for reading each asset file 'jsCompress' => true, //Enable minification js in html code 'jsCompressFlaggedComments' => true, //Cut comments during processing js 'cssCompress' => true, //Enable minification css in html code 'cssFileCompile' => true, //Turning association css files 'cssFileCompileByGroups' => false //Enables the compilation of files in groups rather than in a single file. Works only when the $cssFileCompile option is enabled 'cssFileRemouteCompile' => false, //Trying to get css files to which the specified path as the remote file, skchat him to her. 'cssFileCompress' => true, //Enable compression and processing before being stored in the css file 'cssFileBottom' => false, //Moving down the page css files 'cssFileBottomLoadOnJs' => false, //Transfer css file down the page and uploading them using js 'jsFileCompile' => true, //Turning association js files 'jsFileCompileByGroups' => false //Enables the compilation of files in groups rather than in a single file. Works only when the $jsFileCompile option is enabled 'jsFileRemouteCompile' => false, //Trying to get a js files to which the specified path as the remote file, skchat him to her. 'jsFileCompress' => true, //Enable compression and processing js before saving a file 'jsFileCompressFlaggedComments' => true, //Cut comments during processing js 'noIncludeJsFilesOnPjax' => true, //Do not connect the js files when all pjax requests when all pjax requests when enabled jsFileCompile 'noIncludeCssFilesOnPjax' => true, //Do not connect the css files when all pjax requests when all pjax requests when enabled cssFileCompile 'htmlFormatter' => [ //Enable compression html 'class' => 'abbas13375\yii2\assetsAuto\formatters\html\TylerHtmlCompressor', 'extra' => false, //use more compact algorithm 'noComments' => true, //cut all the html comments 'maxNumberRows' => 50000, //The maximum number of rows that the formatter runs on //or 'class' => 'abbas13375\yii2\assetsAuto\formatters\html\MrclayHtmlCompressor', //or any other your handler implements abbas13375\yii2\assetsAuto\IFormatter interface //or false ], ], //.... ], ];
Links
Demo (view source code)
Screenshot
SkeekS CMS (Yii2) — fast, simple, effective!
skeeks.com | cms.skeeks.com
abbas13375/yii2-assets-auto-compress 适用场景与选型建议
abbas13375/yii2-assets-auto-compress 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 11 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「assets」 「css」 「JS」 「app」 「yii」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 abbas13375/yii2-assets-auto-compress 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 abbas13375/yii2-assets-auto-compress 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 abbas13375/yii2-assets-auto-compress 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Asset Management for PHP
A Twig extension to insert css as inline styles with a tag
Caching and compression for Twig assets (JavaScript and CSS).
Tool for loading or deploying CSS and JS files into web pages
Define your own css rule-sets for the TYPO3 CMS backend.
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-11-28