From b60c7d5a252f3bac13285aaf284eba0985b43dc7 Mon Sep 17 00:00:00 2001 From: timur Date: Mon, 20 Nov 2017 18:54:55 +0200 Subject: [PATCH] autocompress --- composer.json | 3 ++- composer.lock | 601 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- frontend/config/main.php | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 634 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 32764c0..5c63191 100755 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "bower-asset/amcharts-stock": "@dev", "speixoto/yii2-amcharts": "^0.1.1", "2amigos/yii2-tinymce-widget": "~1.1", - "kartik-v/yii2-widget-select2": "@dev" + "kartik-v/yii2-widget-select2": "@dev", + "skeeks/yii2-assets-auto-compress": "*" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", diff --git a/composer.lock b/composer.lock index 2c1eaab..00dec5b 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1ad205bd41e4dfbc52bad09c7e6c1677", + "content-hash": "ae07dde3aabaa4e39a997d4cac66f44f", "packages": [ { "name": "2amigos/yii2-tinymce-widget", @@ -607,6 +607,37 @@ "time": "2016-09-14T20:40:20+00:00" }, { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { "name": "ezyang/htmlpurifier", "version": "v4.9.3", "source": { @@ -1258,6 +1289,59 @@ "time": "2015-09-19T16:54:05+00:00" }, { + "name": "intervention/httpauth", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/Intervention/httpauth.git", + "reference": "69d4627c398c2d74b1c70aae7de7121e0b627c17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/httpauth/zipball/69d4627c398c2d74b1c70aae7de7121e0b627c17", + "reference": "69d4627c398c2d74b1c70aae7de7121e0b627c17", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Intervention\\Httpauth\\HttpauthServiceProvider" + ], + "aliases": { + "Httpauth": "Intervention\\Httpauth\\Facades\\Httpauth" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Httpauth\\": "src/Intervention/Httpauth" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@olivervogel.com", + "homepage": "http://olivervogel.com/" + } + ], + "description": "HTTP authentication (Basic & Digest) including ServiceProviders for easy Laravel integration", + "homepage": "https://github.com/Intervention/httpauth", + "keywords": [ + "Authentication", + "http", + "laravel" + ], + "time": "2017-06-28T17:37:25+00:00" + }, + { "name": "kartik-v/bootstrap-fileinput", "version": "v4.4.1", "source": { @@ -1548,6 +1632,219 @@ "time": "2017-03-13T07:08:03+00:00" }, { + "name": "mrclay/jsmin-php", + "version": "2.3.2", + "source": { + "type": "git", + "url": "https://github.com/mrclay/jsmin-php.git", + "reference": "932c9633c35b390beb2cfdea69a41ea7dbc8d759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mrclay/jsmin-php/zipball/932c9633c35b390beb2cfdea69a41ea7dbc8d759", + "reference": "932c9633c35b390beb2cfdea69a41ea7dbc8d759", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "JSMin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stephen Clay", + "email": "steve@mrclay.org", + "role": "Developer" + }, + { + "name": "Ryan Grove", + "email": "ryan@wonko.com", + "role": "Developer" + } + ], + "description": "Provides a modified port of Douglas Crockford's jsmin.c, which removes unnecessary whitespace from JavaScript files.", + "homepage": "https://github.com/mrclay/jsmin-php/", + "keywords": [ + "compress", + "jsmin", + "minify" + ], + "time": "2015-03-30T15:04:42+00:00" + }, + { + "name": "mrclay/minify", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/mrclay/minify.git", + "reference": "404664509c3d2b3a745e091c86c968a13cba3efc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mrclay/minify/zipball/404664509c3d2b3a745e091c86c968a13cba3efc", + "reference": "404664509c3d2b3a745e091c86c968a13cba3efc", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "intervention/httpauth": "~2.0", + "monolog/monolog": "~1.1", + "mrclay/jsmin-php": "~2", + "mrclay/props-dic": "^2.2", + "php": "^5.3.0 || ^7.0", + "tubalmartin/cssmin": "~4" + }, + "require-dev": { + "firephp/firephp-core": "~0.4.0", + "leafo/scssphp": "~0.6.6", + "marcusschwarz/lesserphp": "~0.5.1", + "meenie/javascript-packer": "~1.1", + "phpunit/phpunit": "4.8.*", + "tedivm/jshrink": "~1.1.0" + }, + "suggest": { + "firephp/firephp-core": "Use FirePHP for Log messages", + "marcusschwarz/lesserphp": "LESS support", + "meenie/javascript-packer": "Keep track of the Packer PHP port using Composer" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Stephen Clay", + "email": "steve@mrclay.org", + "role": "Developer" + } + ], + "description": "Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers", + "homepage": "https://github.com/mrclay/minify", + "time": "2017-11-03T21:00:15+00:00" + }, + { + "name": "mrclay/props-dic", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/mrclay/Props.git", + "reference": "9ed6cf3a027f1eab03abdd134ec209467cf9c77e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mrclay/Props/zipball/9ed6cf3a027f1eab03abdd134ec209467cf9c77e", + "reference": "9ed6cf3a027f1eab03abdd134ec209467cf9c77e", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": ">=5.3.3", + "pimple/pimple": "~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "autoload": { + "psr-0": { + "Props\\": [ + "src/", + "test/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Steve Clay", + "email": "steve@mrclay.org", + "homepage": "http://www.mrclay.org/" + } + ], + "description": "Props is a simple DI container that allows retrieving values via custom property and method names", + "keywords": [ + "container", + "dependency injection", + "dependency injection container", + "di", + "di container" + ], + "time": "2016-02-10T18:59:20+00:00" + }, + { + "name": "natxet/CssMin", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/natxet/CssMin.git", + "reference": "9580f5448f05a82c96cfe6c7063a77807d8ec56d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/9580f5448f05a82c96cfe6c7063a77807d8ec56d", + "reference": "9580f5448f05a82c96cfe6c7063a77807d8ec56d", + "shasum": "" + }, + "require": { + "php": ">=5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ], + "time": "2017-10-04T16:54:00+00:00" + }, + { "name": "noam148/yii2-image-manager", "version": "1.2.5", "source": { @@ -1735,6 +2032,56 @@ "time": "2017-06-05T06:31:10+00:00" }, { + "name": "pimple/pimple", + "version": "v3.2.2", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "4d45fb62d96418396ec58ba76e6f065bca16e10a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/4d45fb62d96418396ec58ba76e6f065bca16e10a", + "reference": "4d45fb62d96418396ec58ba76e6f065bca16e10a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2017-07-23T07:32:15+00:00" + }, + { "name": "psr/cache", "version": "1.0.1", "source": { @@ -1781,6 +2128,55 @@ "time": "2016-08-06T20:24:11+00:00" }, { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { "name": "psr/http-message", "version": "1.0.1", "source": { @@ -1930,6 +2326,63 @@ "time": "2017-01-11T14:05:47+00:00" }, { + "name": "skeeks/yii2-assets-auto-compress", + "version": "1.3.1.2", + "source": { + "type": "git", + "url": "https://github.com/skeeks-semenov/yii2-assets-auto-compress.git", + "reference": "8d3df2f0a50ddde301773e8b40fc48a45363db3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/skeeks-semenov/yii2-assets-auto-compress/zipball/8d3df2f0a50ddde301773e8b40fc48a45363db3b", + "reference": "8d3df2f0a50ddde301773e8b40fc48a45363db3b", + "shasum": "" + }, + "require": { + "mrclay/minify": "*", + "natxet/cssmin": "*", + "tedivm/jshrink": "*", + "yiisoft/yii2": "^2", + "yiisoft/yii2-httpclient": "^2" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "skeeks\\yii2\\assetsAuto\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0+" + ], + "authors": [ + { + "name": "Semenov Alexander", + "email": "semenov@skeeks.com" + }, + { + "name": "SkeekS", + "email": "support@skeeks.com", + "homepage": "https://skeeks.com" + } + ], + "description": "Automatically compile and merge files js + css + html in yii2 project", + "homepage": "http://www.skeeks.com/", + "keywords": [ + "JS", + "Sx", + "app", + "assets", + "auto assets", + "css", + "framework", + "skeeks", + "yii" + ], + "time": "2017-10-05T13:42:22+00:00" + }, + { "name": "speixoto/yii2-amcharts", "version": "v0.1.1", "source": { @@ -2026,6 +2479,52 @@ "time": "2017-05-01T15:54:03+00:00" }, { + "name": "tedivm/jshrink", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/tedious/JShrink.git", + "reference": "667e99774d230525d4d3dc2a50da7ba6b1d56bad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/667e99774d230525d4d3dc2a50da7ba6b1d56bad", + "reference": "667e99774d230525d4d3dc2a50da7ba6b1d56bad", + "shasum": "" + }, + "require": { + "php": "^5.6|^7.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "0.4.0", + "phpunit/phpunit": "4.0.*", + "satooshi/php-coveralls": "^0.7.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "JShrink": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Robert Hafner", + "email": "tedivm@tedivm.com" + } + ], + "description": "Javascript Minifier built in PHP", + "homepage": "http://github.com/tedious/JShrink", + "keywords": [ + "javascript", + "minifier" + ], + "time": "2017-05-30T02:59:46+00:00" + }, + { "name": "tinymce/tinymce", "version": "4.6.3", "source": { @@ -2072,6 +2571,59 @@ "time": "2017-05-30T12:56:46+00:00" }, { + "name": "tubalmartin/cssmin", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port.git", + "reference": "1c7ae93cf6b392d4dae5c4ae18979918413af16e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tubalmartin/YUI-CSS-compressor-PHP-port/zipball/1c7ae93cf6b392d4dae5c4ae18979918413af16e", + "reference": "1c7ae93cf6b392d4dae5c4ae18979918413af16e", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "cogpowered/finediff": "0.3.*", + "phpunit/phpunit": "4.8.*" + }, + "bin": [ + "cssmin" + ], + "type": "library", + "autoload": { + "psr-4": { + "tubalmartin\\CssMin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Túbal Martín", + "homepage": "http://tubalmartin.me/" + } + ], + "description": "A PHP port of the YUI CSS compressor", + "homepage": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port", + "keywords": [ + "compress", + "compressor", + "css", + "cssmin", + "minify", + "yui" + ], + "time": "2017-05-16T13:45:26+00:00" + }, + { "name": "yii2tech/filedb", "version": "1.0.3", "source": { @@ -2320,6 +2872,53 @@ "time": "2016-12-20T13:26:02+00:00" }, { + "name": "yiisoft/yii2-httpclient", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/yiisoft/yii2-httpclient.git", + "reference": "720e3c9bdda260abffe61babfe39b91c4308ac4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yiisoft/yii2-httpclient/zipball/720e3c9bdda260abffe61babfe39b91c4308ac4c", + "reference": "720e3c9bdda260abffe61babfe39b91c4308ac4c", + "shasum": "" + }, + "require": { + "yiisoft/yii2": "~2.0.0" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "yii\\httpclient\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Paul Klimov", + "email": "klimov.paul@gmail.com" + } + ], + "description": "HTTP client extension for the Yii framework", + "keywords": [ + "curl", + "http", + "httpclient", + "yii2" + ], + "time": "2017-06-23T09:36:13+00:00" + }, + { "name": "yiisoft/yii2-imagine", "version": "2.1.0", "source": { diff --git a/frontend/config/main.php b/frontend/config/main.php index df3d398..4e456e5 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -13,7 +13,7 @@ return [ 'id' => 'app-frontend', 'homeUrl' => '/', 'basePath' => dirname(__DIR__), - 'bootstrap' => ['log'], + 'bootstrap' => ['log', 'assetsAutoCompress'], 'controllerNamespace' => 'frontend\controllers', 'components' => [ 'request' => [ @@ -53,6 +53,37 @@ return [ '\/contact' => 'site/contact', ], ], + 'assetsAutoCompress' => + [ + 'class' => '\skeeks\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 + '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 + '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 + + 'htmlCompress' => true, //Enable compression html + + 'htmlCompressOptions' => //options for compressing output result + [ + 'extra' => false, //use more compact algorithm + 'no-comments' => true //cut all the html comments + ], + ], ], 'params' => $params, ]; -- libgit2 0.21.4