Download the PHP package skeeks/yii2-assets-auto-compress without Composer

On this page you can find all versions of the php package skeeks/yii2-assets-auto-compress. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-assets-auto-compress

Automatically compile and merge files js + css + html in yii2 project.

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!

Latest Stable Version Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

or add

How to use

Compiled files and cleanup

Compiled files are named by their content: assets/css-compress/<md5 of content>.css and assets/js-compress/<md5 of content>.js, without ?v=. The set of source URLs (they carry asset directory hashes and ?v=mtime) maps to a compiled file through a small index entry assets/*-compress/.index/<key>. Republishing sources without changing them (a deploy touch, a package reinstall) adds an index entry, not a new copy of the file. Files and index entries are written to .tmp-* and renamed.

A page hit refreshes the mtime of its index entry and compiled file at most once per usageTouchInterval (1 hour). That mtime is the usage mark for cleanup; atime and ctime are not used (backups and chown -R change them).

CompiledFilesCleaner removes files no page has used for days (7) days: expired index entries, compiled files no live entry points to and that are older than the retention, and .tmp-<16 hex> files older than an hour. Files of the previous naming scheme have no index entry; they are removed only when the retention has also passed since the switch (.index/.since), so HTML rendered before the upgrade keeps its files. Without .since no compiled file is removed (expired index entries and stale temporary files still are). Entries with other names are left alone. It reads directory listings, stat() and the small index entries, never the compiled content. If a directory or a live index entry cannot be read, no compiled file of that directory is removed and the run reports an error.

Pages refresh usage marks and store files under a shared flock on .index/.lock; cleanup re-checks the mark and unlinks under an exclusive one. A page that marked a file in time keeps it; a page that comes too late finds it gone and compiles again instead of recreating it empty. Only the hourly mark refresh and a store take the lock; an ordinary hit does not, and only when its mark is known to be fresh (a vanished index entry is a miss). If the lock cannot be taken, the page uses its source files (with a warning in the log); if touch() is refused (a file of another owner), the store rewrites the file, which gives it a fresh mark. The compiled file is marked before its index entry, so a fresh entry always points to a fresh file.

getSettingsHash() is part of the index key and lists the options that change the compiled content (and the resolved webroot). A subclass adding such an option must extend it.

A removed compiled file is rebuilt by the next page that renders it; a direct request to it from an old HTML page gets 404, which is why the retention counts from the last use. skeeks/cms-assets-auto-compress runs the cleanup daily as a cms-job job.

Tests: php tests/compiled-files.php vendor/autoload.php.

Links

Demo (view source code)

Screenshot

SkeekS CMS admin panel


SkeekS CMS admin panel


SkeekS CMS admin panel


SkeekS CMS admin panel


skeeks!
SkeekS CMS (Yii2) — fast, simple, effective!
skeeks.com | cms.skeeks.com

CSS: отказ от обязательного mrclay/minify

CSS-обработка перенесена из mrclay/minify 3.0.14 в отдельную папку нашего пакета без изменения алгоритмов. Это убирает обязательную цепочку к abandoned-пакету marcusschwarz/lesserphp, который не нужен для обработки CSS. Лицензия и авторство сохранены. Причины, состав, ограничения, обновление сайтов и будущий план перехода на matthiasmullie/minify описаны в документации.

Важно: старый альтернативный MrclayHtmlCompressor требует явной установки mrclay/minify; основной TylerHtmlCompressor этой зависимости не требует.


All versions of yii2-assets-auto-compress with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version ^2
yiisoft/yii2-httpclient Version ^2
tedivm/jshrink Version v1.6.6
skeeks/cssmin Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package skeeks/yii2-assets-auto-compress contains the following files

Loading the files please wait ...