├── CHANGELOG.md
├── LICENSE
├── README.md
├── composer.json
├── docs
├── assets
│ ├── favicon.ico
│ ├── flame.svg
│ ├── github-dark-dimmed.css
│ └── hljs.js
├── basic-usage.md
├── configuration.md
├── index.md
└── installation.md
├── infection.json.dist
├── mkdocs.yml
├── psalm.xml
├── psalm_autoload.php
├── src
├── Adapters
│ ├── AdapterInterface.php
│ ├── Css
│ │ └── MinifyAdapter.php
│ └── Js
│ │ └── MinifyAdapter.php
├── Commands
│ ├── MinifyAll.php
│ ├── MinifyCss.php
│ ├── MinifyJs.php
│ └── MinifyPublish.php
├── Config
│ ├── Minifier.php
│ └── Services.php
├── Exceptions
│ └── MinifierException.php
├── Helpers
│ └── minifier_helper.php
├── Language
│ └── en
│ │ └── Minifier.php
└── Minifier.php
└── tests
├── Commands
├── MinifyAllTest.php
├── MinifyCssTest.php
├── MinifyJsTest.php
└── MinifyPublishTest.php
├── MinifierTest.php
└── _support
├── CLITestCase.php
├── TestCase.php
├── assets
├── css
│ ├── bootstrap.css
│ ├── font-awesome.css
│ └── main.css
└── js
│ ├── bootstrap.js
│ ├── jquery-3.7.1.js
│ └── main.js
└── public
├── css
└── .gitkeep
└── js
└── .gitkeep
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All notable changes to this project will be documented in this file.
3 |
4 | ## [Unreleased]
5 |
6 | ## [2.0.0] - 2023-12-27
7 | ### Changed
8 | - Minimum PHP version bumped to 8.1
9 | - All deprecated methods has been removed: `autoDeployCheck()`, `autoDeployCheckJs()`, `autoDeployCheckCss()`, `deployJs()`, `deployCss()`, `emptyFolder()`
10 | - Signature for `AdapterInterface` methods has changed
11 |
12 | ### Added
13 | - Code quality tools: PHPStan, Psalm, Rector
14 | - Proper documentation
15 |
16 | ## [1.4.1] - 2021-11-22
17 | ### Fixed
18 | - Fixed an issue with `autoDeployOnChange` option, when `minDirJs` or `minDirCss` was set. Thanks to [@paul45](https://github.com/paul45)
19 |
20 | ## [1.4.0] - 2021-11-21
21 | ### Fixed
22 | - [#7](https://github.com/michalsn/minifier/issues/7) - The logic around the `emptyFolder()` method could be problematic in some cases, so it was removed entirely.
23 | ### Changed
24 | - Method `emptyFolder()` was deprecated.
25 | - Methods `deployJs()` and `deployCss()` were deprecated in favor of `deployFiles()`.
26 | - Methods `autoDeployCheckJs()`, `autoDeployCheckCss()` and `autoDeployCheck()` were deprecated in favor of `autoDeployCheckFile()`.
27 |
28 | ## [1.3.0] - 2021-10-21
29 | ### Added
30 | - New config variables `$dirMinJs` and `$dirMinCss` that allow to specify separate directories for minified assets - by [@daycry](https://github.com/daycry)
31 |
32 | ## [1.2.0] - 2021-01-01
33 | ### Added
34 | - New config variable `$autoDeployOnChange` that specifies if we want to make a deploy automatically whenever any change happens to our assets files. Thanks to [@paul45](https://github.com/paul45) for inspiration.
35 |
36 | ## [1.1.0] - 2020-04-23
37 | ### Added
38 | - New config variable `$returnType` that specifies if we want to get `html` (default), `json` or php `array` as a result when we load a file to display.
39 | - New optional config variables `$baseJsUrl` and `$baseCssUrl` to handle serving assets from separate domains.
40 |
41 | ### Changed
42 | - Use spaces instead of tabs.
43 | - Updates in README file.
44 |
45 | ### Fixed
46 | - Fix wrong message name for `noVersioningFile` by [@paul45](https://github.com/paul45)
47 | - Fix the way `versions.json` file is set.
48 |
49 | ## [1.0.0] - 2020-03-27
50 | - Initial release
51 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019-2023 Michal Sniatala
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Minifier
2 |
3 | Asset minification and versioning library for CodeIgniter 4.
4 |
5 | [](https://github.com/michalsn/minifier/actions/workflows/phpunit.yml)
6 | [](https://github.com/michalsn/minifier/actions/workflows/phpstan.yml)
7 | [](https://github.com/michalsn/minifier/actions/workflows/deptrac.yml)
8 | [](https://coveralls.io/github/michalsn/minifier?branch=develop)
9 |
10 | 
11 | 
12 |
13 | ## Installation
14 |
15 | ```console
16 | composer require michalsn/minifier
17 | ```
18 |
19 | ## Configuration
20 |
21 | Run command:
22 |
23 | ```console
24 | php spark minify:publish
25 | ```
26 |
27 | This command will copy a config file to your app namespace.
28 | Then you can adjust it to your needs. By default, file will be present in `app/Config/Minifier.php`.
29 |
30 | You should define an array of files that you want to minify, ie:
31 |
32 | ```php
33 | public $js = [
34 | 'all.min.js' => [
35 | 'jquery-3.7.1.min.js', 'bootstrap-3.3.7.min.js', 'main.js',
36 | ]
37 | ];
38 |
39 | // or / and
40 |
41 | public $css = [
42 | 'all.min.css' => [
43 | 'bootstrap-3.3.7.min.css', 'font-awesome-4.7.0.min.css', 'main.css',
44 | ]
45 | ];
46 | ```
47 |
48 | This way requesting for a `all.min.js` or `all.min.css` file will return a minified and combined version of all files in a given array.
49 |
50 | ## Docs
51 |
52 | Read the full documentation: https://michalsn.github.io/minifier/
53 |
54 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "michalsn/minifier",
3 | "description": "Assets minification and versioning library for CodeIgniter 4.",
4 | "keywords": [
5 | "codeigniter", "minification", "minify", "assets", "codeigniter4", "versioning"
6 | ],
7 | "license": "MIT",
8 | "type": "library",
9 | "authors": [
10 | {
11 | "name": "michalsn",
12 | "homepage": "https://github.com/michalsn",
13 | "role": "Developer"
14 | }
15 | ],
16 | "homepage": "https://github.com/michalsn/minifier",
17 | "require": {
18 | "php" : "^8.1",
19 | "matthiasmullie/minify": "^1.3"
20 | },
21 | "require-dev": {
22 | "codeigniter4/devkit": "^1.0",
23 | "codeigniter4/framework": "^4.1"
24 | },
25 | "minimum-stability": "dev",
26 | "prefer-stable": true,
27 | "autoload": {
28 | "psr-4": {
29 | "Michalsn\\Minifier\\": "src"
30 | }
31 | },
32 | "autoload-dev": {
33 | "psr-4": {
34 | "Tests\\": "tests"
35 | }
36 | },
37 | "config": {
38 | "allow-plugins": {
39 | "phpstan/extension-installer": true
40 | }
41 | },
42 | "scripts": {
43 | "analyze": [
44 | "phpstan analyze",
45 | "psalm",
46 | "rector process --dry-run"
47 | ],
48 | "sa": "@analyze",
49 | "ci": [
50 | "Composer\\Config::disableProcessTimeout",
51 | "@cs",
52 | "@deduplicate",
53 | "@inspect",
54 | "@analyze",
55 | "@test"
56 | ],
57 | "cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff",
58 | "cs-fix": "php-cs-fixer fix --ansi --verbose --diff",
59 | "style": "@cs-fix",
60 | "deduplicate": "phpcpd app/ src/",
61 | "inspect": "deptrac analyze --cache-file=build/deptrac.cache",
62 | "mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
63 | "test": "phpunit"
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/docs/assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michalsn/minifier/e85218707ff5833c6e8b8efb162b7af45d207d35/docs/assets/favicon.ico
--------------------------------------------------------------------------------
/docs/assets/flame.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/docs/assets/github-dark-dimmed.css:
--------------------------------------------------------------------------------
1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2 | Theme: GitHub Dark Dimmed
3 | Description: Dark dimmed theme as seen on github.com
4 | Author: github.com
5 | Maintainer: @Hirse
6 | Updated: 2021-05-15
7 | Modified: 2022:12:27 by @michalsn
8 |
9 | Colors taken from GitHub's CSS
10 | */.hljs{color:#adbac7 !important;background-color:#22272e !important}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#f47067}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#dcbdfb}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#6cb6ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#96d0ff}.hljs-built_in,.hljs-symbol{color:#f69d50}.hljs-code,.hljs-comment,.hljs-formula{color:#768390}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#8ddb8c}.hljs-subst{color:#adbac7}.hljs-section{color:#316dca;font-weight:700}.hljs-bullet{color:#eac55f}.hljs-emphasis{color:#adbac7;font-style:italic}.hljs-strong{color:#adbac7;font-weight:700}.hljs-addition{color:#b4f1b4;background-color:#1b4721}.hljs-deletion{color:#ffd8d3;background-color:#78191b}
11 |
12 | [data-md-color-scheme="default"] {
13 | --md-default-fg-color--lightest: #575757;
14 | --md-default-fg-color--light: #959595;
15 | }
16 |
--------------------------------------------------------------------------------
/docs/assets/hljs.js:
--------------------------------------------------------------------------------
1 | window.document$.subscribe(() => {
2 | hljs.highlightAll();
3 | });
4 |
--------------------------------------------------------------------------------
/docs/basic-usage.md:
--------------------------------------------------------------------------------
1 | # Basic Usage
2 |
3 | After [defining our files](configuration.md#config-file) we want to actually minify all the files we have. This is easy enough as running the command:
4 |
5 | ```console
6 | php spark minify:all
7 | ```
8 |
9 | This will prepare everything and will set up a versioning. Make sure to load a minifier helper in your controller, by calling:
10 |
11 | ```php
12 | helper('minifier');
13 | ```
14 |
15 | Now to generate a proper tag with desired file to load, you have to make a simple call in your code:
16 |
17 | ```php
18 | minifier('all.min.js');
19 |
20 | // or / and
21 |
22 | minifier('all.min.css');
23 | ```
24 |
25 | This will produce:
26 |
27 | ```html
28 |
30 |
31 |
32 |
33 |
35 | ```
36 |
--------------------------------------------------------------------------------
/docs/configuration.md:
--------------------------------------------------------------------------------
1 | # Configuration
2 |
3 | ## Config File
4 |
5 | To make changes to the config file, we have to have our copy in the `app/Config/Minifier.php`. Luckily, this package comes with handy command that will make this easy.
6 |
7 | When we run:
8 |
9 | ```console
10 | php spark minify:publish
11 | ```
12 |
13 | We will get our copy ready for modifications.
14 |
15 | Now, you should define an array of files that you want to minify, ie:
16 |
17 | ```php
18 | public array $js = [
19 | 'all.min.js' => [
20 | 'jquery-3.7.1.min.js', 'bootstrap-3.3.7.min.js', 'main.js',
21 | ]
22 | ];
23 |
24 | // or / and
25 |
26 | public array $css = [
27 | 'all.min.css' => [
28 | 'bootstrap-3.3.7.min.css', 'font-awesome-4.7.0.min.css', 'main.css',
29 | ]
30 | ];
31 | ```
32 |
33 | This way requesting for a `all.min.js` or `all.min.css` file will return a minified and combined version of all files in a given array.
34 |
35 | ## Config Options
36 |
37 | ### $minify
38 |
39 | Use this variable to turn on and off minification of the assets. Turning off can be useful during app development - for easy debugging.
40 |
41 | **Available options**: `true`, `false`
42 |
43 | **Default value**: `true`
44 |
45 | ### $baseUrl
46 |
47 | Use this variable when you want to set absolute path to the asset files. If no other URLs are set, like `$baseJsUrl` or `$baseCssUrl` then values set to `$dirJS` and `$dirCss` will be added to the final URL.
48 |
49 | **Default value**: `null`
50 |
51 | ### $baseJsUrl
52 |
53 | Use this variable when your JS assets are served from subdomain. Keep in mind that in this case variable `$dirJs` won't be added to the URL.
54 |
55 | **Default value**: `null`
56 |
57 | ### $baseCssUrl
58 |
59 | Use this variable when your CSS assets are served from subdomain. Keep in mind that in this case variable `$dirCSS` won't be added to the URL.
60 |
61 | **Default value**: `null`
62 |
63 | ### $adapterJs
64 |
65 | Adapter to use for minifying JS files. You can also implement your own JS adapter to minify assets and replace this class.
66 |
67 | **Default value**: `\Michalsn\Minifier\Adapters\Js\MinifyAdapter::class`
68 |
69 | ### $adapterCss
70 |
71 | Adapter to use for minifying CSS files. You can also implement your own CSS adapter to minify assets and replace this class.
72 |
73 | **Default value**: `\Michalsn\Minifier\Adapters\Css\MinifyAdapter::class`
74 |
75 | ### $dirJs
76 |
77 | JS assets directory.
78 |
79 | **Default value**: `./assets/js`
80 |
81 | ### $dirCss
82 |
83 | CSS assets directory.
84 |
85 | **Default value**: `./assets/css`
86 |
87 | ### $dirMinJs
88 |
89 | Minified JS asset directory. If not set the value from `$dirJs` will be used instead.
90 |
91 | **Default value**: `null`
92 |
93 | ### $dirMinCss
94 |
95 | Minified CSS asset directory. If not set the value from `$dirCss` will be used instead.
96 |
97 | **Default value**: `null`
98 |
99 | ### $dirVersion
100 |
101 | Directory to store assets versioning.
102 |
103 | **Default value**: `./assets`
104 |
105 | ### $tagJs
106 |
107 | JS tag to use in HTML when displaying JS assets.
108 |
109 | **Default value**: ``
110 |
111 | ### $tagCss
112 |
113 | CSS tag to use in HTML when displaying CSS assets.
114 |
115 | **Default value**: ``
116 |
117 | ### $returnType
118 |
119 | Determines how the files will be returned. The default value is `html` and it uses the `$tagJs` and `$tagCss` variables. Using `array` will return the php array and `json` type will return a json string.
120 |
121 | **Available options**: `html`, `json`, `array`
122 |
123 | **Default value**: `html`
124 |
125 | ### $autoDeployOnChange
126 |
127 | Specifies if we want to automatically deploy whenever there is a change to any of our assets files. Keep in mind that enabling this feature will have an impact on performance.
128 |
129 | **Available options**: `true`, `false`
130 |
131 | **Default value**: `false`
132 |
133 | ### $js
134 |
135 | This array defines JS files to minify.
136 |
137 | ### $css
138 |
139 | This array defines CSS files to minify.
140 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # CodeIgniter Minifier Documentation
2 |
3 | Asset minification and versioning library for CodeIgniter 4.
4 |
5 | ### Requirements
6 |
7 | 
8 | 
9 |
10 | ## Overview
11 |
12 | We can define files we want to combine and minify:
13 |
14 | ```php
15 | public $js = [
16 | 'all.min.js' => ['file1.js', 'file2.js']
17 | ];
18 | ```
19 |
20 | And then use it with only one line:
21 |
22 | ```php
23 | echo minifier('all.min.js');
24 | ```
25 |
26 | This will return ready to use HTML tag:
27 |
28 | ```html
29 |
30 | ```
31 |
32 |
--------------------------------------------------------------------------------
/docs/installation.md:
--------------------------------------------------------------------------------
1 | # Installation
2 |
3 | ## Composer Installation
4 |
5 | The only thing you have to do is to run this command, and you're ready to go.
6 |
7 | ```console
8 | composer require michalsn/minifier
9 | ```
10 |
--------------------------------------------------------------------------------
/infection.json.dist:
--------------------------------------------------------------------------------
1 | {
2 | "source": {
3 | "directories": [
4 | "src/"
5 | ],
6 | "excludes": [
7 | "Config",
8 | "Database/Migrations",
9 | "Views"
10 | ]
11 | },
12 | "logs": {
13 | "text": "build/infection.log"
14 | },
15 | "mutators": {
16 | "@default": true
17 | },
18 | "bootstrap": "vendor/codeigniter4/framework/system/Test/bootstrap.php"
19 | }
20 |
--------------------------------------------------------------------------------
/mkdocs.yml:
--------------------------------------------------------------------------------
1 | site_name: CodeIgniter Minifier
2 | site_description: Documentation for asset minification and versioning library for CodeIgniter 4
3 |
4 | theme:
5 | name: material
6 | logo: assets/flame.svg
7 | favicon: assets/favicon.ico
8 | icon:
9 | repo: fontawesome/brands/github
10 | palette:
11 | - media: "(prefers-color-scheme: light)"
12 | scheme: default
13 | primary: indigo
14 | accent: indigo
15 | toggle:
16 | icon: material/brightness-7
17 | name: Switch to dark mode
18 | - media: "(prefers-color-scheme: dark)"
19 | scheme: slate
20 | primary: indigo
21 | accent: indigo
22 | toggle:
23 | icon: material/brightness-4
24 | name: Switch to light mode
25 | features:
26 | - navigation.instant
27 |
28 | extra:
29 | homepage: https://michalsn.github.io/minifier
30 |
31 | social:
32 | - icon: fontawesome/brands/github
33 | link: https://github.com/michalsn/minifier
34 | name: GitHub
35 |
36 | site_url: https://michalsn.github.io/minifier/
37 | repo_url: https://github.com/michalsn/minifier
38 | edit_uri: edit/develop/docs/
39 |
40 | markdown_extensions:
41 | - pymdownx.superfences
42 | - pymdownx.highlight:
43 | use_pygments: false
44 |
45 | extra_css:
46 | - assets/github-dark-dimmed.css
47 |
48 | extra_javascript:
49 | - https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.6.0/build/highlight.min.js
50 | - assets/hljs.js
51 |
52 | nav:
53 | - Home: index.md
54 | - Installation: installation.md
55 | - Configuration: configuration.md
56 | - Basic Usage: basic-usage.md
57 |
--------------------------------------------------------------------------------
/psalm.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/psalm_autoload.php:
--------------------------------------------------------------------------------
1 | adapter = new CSS();
21 | }
22 |
23 | /**
24 | * Add file
25 | *
26 | * @param string $file File name
27 | *
28 | * @return void;
29 | */
30 | public function add(string $file): void
31 | {
32 | $this->adapter->add($file);
33 | }
34 |
35 | /**
36 | * Minify file
37 | *
38 | * @param string $file File name
39 | *
40 | * @return void;
41 | */
42 | public function minify(string $file): void
43 | {
44 | $this->adapter->minify($file);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Adapters/Js/MinifyAdapter.php:
--------------------------------------------------------------------------------
1 | adapter = new JS();
21 | }
22 |
23 | /**
24 | * Add file
25 | *
26 | * @param string $file File name
27 | *
28 | * @return void;
29 | */
30 | public function add(string $file): void
31 | {
32 | $this->adapter->add($file);
33 | }
34 |
35 | /**
36 | * Minify file
37 | *
38 | * @param string $file File name
39 | *
40 | * @return void;
41 | */
42 | public function minify(string $file): void
43 | {
44 | $this->adapter->minify($file);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Commands/MinifyAll.php:
--------------------------------------------------------------------------------
1 | start('minifier');
23 |
24 | $minify = service('minifier');
25 | $result = $minify->deploy();
26 |
27 | $benchmark->stop('minifier');
28 |
29 | if (! $result) {
30 | CLI::error($minify->getError());
31 |
32 | return;
33 | }
34 |
35 | $time = $benchmark->getElapsedTime('minifier');
36 |
37 | CLI::write('Finished in: ' . $time . 's.');
38 | CLI::write('All files were successfully generated.', 'green');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Commands/MinifyCss.php:
--------------------------------------------------------------------------------
1 | start('minifier');
23 |
24 | $minify = service('minifier');
25 | $result = $minify->deploy('css');
26 |
27 | $benchmark->stop('minifier');
28 |
29 | if (! $result) {
30 | CLI::error($minify->getError());
31 |
32 | return;
33 | }
34 |
35 | $time = $benchmark->getElapsedTime('minifier');
36 |
37 | CLI::write('Finished in: ' . $time . 's.');
38 | CLI::write('CSS files were successfully generated.', 'green');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Commands/MinifyJs.php:
--------------------------------------------------------------------------------
1 | start('minifier');
23 |
24 | $minify = service('minifier');
25 | $result = $minify->deploy('js');
26 |
27 | $benchmark->stop('minifier');
28 |
29 | if (! $result) {
30 | CLI::error($minify->getError());
31 |
32 | return;
33 | }
34 |
35 | $time = $benchmark->getElapsedTime('minifier');
36 |
37 | CLI::write('Finished in: ' . $time . 's.');
38 | CLI::write('JS files were successfully generated.', 'green');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Commands/MinifyPublish.php:
--------------------------------------------------------------------------------
1 | getNamespace('Michalsn\\Minifier')[0];
22 |
23 | $publisher = new Publisher($source, APPPATH);
24 |
25 | try {
26 | $publisher->addPaths([
27 | 'Config/Minifier.php',
28 | ])->merge(false);
29 | } catch (Throwable $e) {
30 | $this->showError($e);
31 |
32 | return;
33 | }
34 |
35 | foreach ($publisher->getPublished() as $file) {
36 | $contents = file_get_contents($file);
37 | $contents = str_replace('namespace Michalsn\\Minifier\\Config', 'namespace Config', $contents);
38 | $contents = str_replace('use CodeIgniter\\Config\\BaseConfig', 'use Michalsn\\Minifier\\Config\\Minifier as BaseMinifier', $contents);
39 | $contents = str_replace('class Minifier extends BaseConfig', 'class Minifier extends BaseMinifier', $contents);
40 | file_put_contents($file, $contents);
41 | }
42 |
43 | CLI::write(CLI::color(' Published! ', 'green') . 'You can customize the configuration by editing the "app/Config/Minifier.php" file.');
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Config/Minifier.php:
--------------------------------------------------------------------------------
1 | ';
103 |
104 | // --------------------------------------------------------------------
105 | // CSS tag
106 | // --------------------------------------------------------------------
107 |
108 | public string $tagCss = '';
109 |
110 | // --------------------------------------------------------------------
111 | // Return type
112 | // --------------------------------------------------------------------
113 | // Determines how the files will be returned. The default value is
114 | // 'html' and it uses the $tagJs and $tagCss variables. Using 'array'
115 | // will return the php array and 'json' type will return a json string.
116 | //
117 | // Available types:
118 | // 'html', 'array', 'json'
119 |
120 | public string $returnType = 'html';
121 |
122 | // --------------------------------------------------------------------
123 | // Enable auto deploy on change
124 | // --------------------------------------------------------------------
125 | // Use this variable to automatically deploy when there are any
126 | // changes in assets files.
127 |
128 | public bool $autoDeployOnChange = false;
129 |
130 | // --------------------------------------------------------------------
131 | // JS files config
132 | // --------------------------------------------------------------------
133 | // This array defines files to minify.
134 | //
135 | // Example array:
136 | // 'all.min.js' => [
137 | // 'jquery-3.2.1.min.js', 'bootstrap-3.3.7.min.js', 'main.js',
138 | // ],
139 |
140 | public array $js = [];
141 |
142 | // --------------------------------------------------------------------
143 | // CSS files config
144 | // --------------------------------------------------------------------
145 | // This array defines files to minify.
146 | //
147 | // Example array:
148 | // 'all.min.css' => [
149 | // 'bootstrap-3.3.7.min.css', 'font-awesome-4.7.0.min.css', 'main.css',
150 | // ],
151 |
152 | public array $css = [];
153 | }
154 |
--------------------------------------------------------------------------------
/src/Config/Services.php:
--------------------------------------------------------------------------------
1 | load($filename);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Language/en/Minifier.php:
--------------------------------------------------------------------------------
1 | 'Wrong file extension: ".{0}".',
6 | 'noVersioningFile' => 'There is no file with versioning. Run "php spark minify:all" command first.',
7 | 'incorrectDeploymentMode' => 'The "{0}" is not correct deployment mode.',
8 | 'wrongReturnType' => 'The "{0}" is not correct return type.',
9 | 'fileCopyError' => 'The "{0}" file cannot be copied to "{1}".',
10 | ];
11 |
--------------------------------------------------------------------------------
/src/Minifier.php:
--------------------------------------------------------------------------------
1 | config->returnType, ['html', 'array', 'json'], true)) {
38 | throw MinifierException::forWrongReturnType($this->config->returnType);
39 | }
40 |
41 | if ($this->config->autoDeployOnChange) {
42 | $this->autoDeployCheckFile($ext, $filename);
43 | }
44 |
45 | // load versions
46 | $versions = $this->getVersion($this->config->dirVersion);
47 |
48 | $filenames = [];
49 |
50 | // do we use combined+minified+versioned assets?
51 | if ($this->config->minify) {
52 | if (isset($versions[$ext][$filename])) {
53 | $filenames[] = $filename . '?v=' . $versions[$ext][$filename];
54 | }
55 | } else {
56 | // load all files from config array for this filename
57 | $type = $this->config->{$ext};
58 | $filenames = $type[$filename];
59 | }
60 |
61 | // determine tag template for file
62 | $tag = ($ext === 'js') ? $this->config->tagJs : $this->config->tagCss;
63 |
64 | // determine base URL address
65 | $dir = $this->determineUrl($ext);
66 |
67 | // prepare output
68 | return $this->prepareOutput($filenames, $dir, $tag);
69 | }
70 |
71 | /**
72 | * Deploy
73 | *
74 | * @param string $mode Deploy mode
75 | */
76 | public function deploy(string $mode = 'all'): bool
77 | {
78 | if (! in_array($mode, ['all', 'js', 'css'], true)) {
79 | throw MinifierException::forIncorrectDeploymentMode($mode);
80 | }
81 |
82 | try {
83 | $files = match ($mode) {
84 | 'js' => $this->deployFiles('js', $this->config->js, $this->config->dirJs, $this->config->dirMinJs),
85 | 'css' => $this->deployFiles('css', $this->config->css, $this->config->dirCss, $this->config->dirMinCss),
86 | default => [
87 | 'js' => $this->deployFiles('js', $this->config->js, $this->config->dirJs, $this->config->dirMinJs),
88 | 'css' => $this->deployFiles('css', $this->config->css, $this->config->dirCss, $this->config->dirMinCss),
89 | ],
90 | };
91 |
92 | $this->setVersion($mode, $files, $this->config->dirVersion);
93 |
94 | return true;
95 | } catch (Exception $e) {
96 | $this->error = $e->getMessage();
97 |
98 | return false;
99 | }
100 | }
101 |
102 | /**
103 | * Return error
104 | */
105 | public function getError(): string
106 | {
107 | return $this->error;
108 | }
109 |
110 | /**
111 | * Auto deploy check for CSS files
112 | *
113 | * @param string $fileType File type [css, js]
114 | * @param string $filename Filename
115 | */
116 | protected function autoDeployCheckFile(string $fileType, string $filename): bool
117 | {
118 | $dir = 'dir' . ucfirst(strtolower($fileType));
119 | $dirMin = 'dirMin' . ucfirst(strtolower($fileType));
120 |
121 | if ($this->config->{$dirMin} === null) {
122 | $dirMin = $dir;
123 | }
124 |
125 | $assets = [$filename => $this->config->{$fileType}[$filename]];
126 | $filePath = $this->config->{$dirMin} . DIRECTORY_SEPARATOR . $filename;
127 |
128 | // if file is not deployed
129 | if (! file_exists($filePath)) {
130 | $this->deployFiles($fileType, $assets, $this->config->{$dir}, $this->config->{$dirMin});
131 |
132 | return true;
133 | }
134 |
135 | // get last deploy time
136 | $lastDeployTime = filemtime($filePath);
137 |
138 | // loop though the files and check last update time
139 | foreach ($assets[$filename] as $file) {
140 | $currentFileTime = filemtime($this->config->{$dir} . DIRECTORY_SEPARATOR . $file);
141 | if ($currentFileTime > $lastDeployTime) {
142 | $this->deployFiles($fileType, $assets, $this->config->{$dir}, $this->config->{$dirMin});
143 |
144 | return true;
145 | }
146 | }
147 |
148 | return false;
149 | }
150 |
151 | /**
152 | * Determine URL address for asset
153 | *
154 | * @param string $ext Extension type
155 | */
156 | protected function determineUrl(string $ext): string
157 | {
158 | if ($ext === 'js' && $this->config->baseJsUrl !== null) {
159 | return rtrim($this->config->baseJsUrl, '/');
160 | }
161 |
162 | if ($ext === 'css' && $this->config->baseCssUrl !== null) {
163 | return rtrim($this->config->baseCssUrl, '/');
164 | }
165 |
166 | // determine file folder
167 | $dir = ($ext === 'js') ? $this->config->dirMinJs : $this->config->dirMinCss;
168 | $dir = ltrim(trim($dir, '/'), './');
169 |
170 | // add base url if needed
171 | if ($this->config->baseUrl !== null) {
172 | $dir = rtrim($this->config->baseUrl, '/') . '/' . $dir;
173 | }
174 |
175 | return $dir;
176 | }
177 |
178 | /**
179 | * Prepare output to return a desired format
180 | *
181 | * @param array $filenames Filenames to return
182 | * @param string $dir Directory
183 | * @param string $tag HTML tag
184 | */
185 | protected function prepareOutput(array $filenames, string $dir, string $tag): array|string
186 | {
187 | // prepare output
188 | $output = '';
189 |
190 | foreach ($filenames as &$file) {
191 | if ($this->config->returnType === 'html') {
192 | $output .= sprintf($tag, $dir . '/' . $file) . PHP_EOL;
193 | } else {
194 | $file = $dir . '/' . $file;
195 | }
196 | }
197 |
198 | if ($this->config->returnType === 'html') {
199 | return $output;
200 | }
201 |
202 | if ($this->config->returnType === 'json') {
203 | return json_encode($filenames);
204 | }
205 |
206 | return $filenames;
207 | }
208 |
209 | /**
210 | * Load version file
211 | *
212 | * @param string $dir Directory
213 | */
214 | protected function getVersion(string $dir): array
215 | {
216 | static $versions = null;
217 |
218 | // load all versions numbers
219 | if ($versions === null) {
220 | $dir = rtrim($dir, DIRECTORY_SEPARATOR);
221 |
222 | if (! file_exists($dir . DIRECTORY_SEPARATOR . 'versions.json')) {
223 | throw MinifierException::forNoVersioningFile();
224 | }
225 |
226 | $versions = json_decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'versions.json'), true);
227 | }
228 |
229 | return $versions;
230 | }
231 |
232 | /**
233 | * Set version
234 | *
235 | * @param string $mode Mode
236 | * @param array $files Files
237 | * @param string $dir Directory
238 | */
239 | protected function setVersion(string $mode, array $files, string $dir): void
240 | {
241 | $versions = [];
242 | $dir = rtrim($dir, DIRECTORY_SEPARATOR);
243 |
244 | if (file_exists($dir . DIRECTORY_SEPARATOR . 'versions.json')) {
245 | $versions = json_decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'versions.json'), true);
246 | }
247 |
248 | if ($mode === 'all') {
249 | $versions = $files;
250 | } else {
251 | $versions[$mode] = $files;
252 | }
253 |
254 | file_put_contents($dir . DIRECTORY_SEPARATOR . 'versions.json', json_encode($versions));
255 | }
256 |
257 | /**
258 | * Deploy files
259 | *
260 | * @param string $fileType File type [css, js]
261 | * @param array $assets CSS assets
262 | * @param string $dir Directory
263 | * @param string|null $minDir Minified directory
264 | */
265 | protected function deployFiles(string $fileType, array $assets, string $dir, ?string $minDir = null): array
266 | {
267 | $adapterType = 'adapter' . ucfirst(strtolower($fileType));
268 |
269 | $dir = rtrim($dir, '/');
270 |
271 | if ($minDir === null) {
272 | $minDir = $dir;
273 | }
274 |
275 | $class = $this->config->{$adapterType};
276 |
277 | $results = [];
278 |
279 | foreach ($assets as $asset => $files) {
280 | $minClass = new $class();
281 |
282 | foreach ($files as $file) {
283 | if ($this->config->minify) {
284 | $minClass->add($dir . DIRECTORY_SEPARATOR . $file);
285 | } elseif ($dir !== $minDir) {
286 | $this->copyFile($dir . DIRECTORY_SEPARATOR . $file, $minDir . DIRECTORY_SEPARATOR . $file);
287 | $results[$file] = md5_file($minDir . DIRECTORY_SEPARATOR . $file);
288 | }
289 | }
290 |
291 | if ($this->config->minify) {
292 | $minClass->minify($minDir . DIRECTORY_SEPARATOR . $asset);
293 | $results[$asset] = md5_file($minDir . DIRECTORY_SEPARATOR . $asset);
294 | }
295 | }
296 |
297 | return $results;
298 | }
299 |
300 | /**
301 | * Copy File
302 | *
303 | * @param string $dir Directory
304 | * @param string $minDir Minified directory
305 | */
306 | protected function copyFile(string $dir, string $minDir): void
307 | {
308 | $path = pathinfo($minDir);
309 |
310 | if (! file_exists($path['dirname'])) {
311 | mkdir($path['dirname'], 0755, true);
312 | }
313 |
314 | if (! copy($dir, $minDir)) {
315 | throw MinifierException::forFileCopyError($dir, $minDir);
316 | }
317 | }
318 | }
319 |
--------------------------------------------------------------------------------
/tests/Commands/MinifyAllTest.php:
--------------------------------------------------------------------------------
1 | assertNotFalse(command('minify:all'));
19 | $output = $this->parseOutput(CITestStreamFilter::$buffer);
20 |
21 | CITestStreamFilter::removeErrorFilter();
22 |
23 | $this->assertSame('file_put_contents(./assets/versions.json): Failed to open stream: No such file or directory', $output);
24 | }
25 |
26 | public function testRun(): void
27 | {
28 | $this->setMinifierConfig();
29 |
30 | CITestStreamFilter::registration();
31 | CITestStreamFilter::addOutputFilter();
32 |
33 | $this->assertNotFalse(command('minify:all'));
34 | $this->parseOutput(CITestStreamFilter::$buffer);
35 |
36 | CITestStreamFilter::removeOutputFilter();
37 |
38 | $this->assertSame('All files were successfully generated.', $this->getLine(1));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/tests/Commands/MinifyCssTest.php:
--------------------------------------------------------------------------------
1 | assertNotFalse(command('minify:css'));
19 | $output = $this->parseOutput(CITestStreamFilter::$buffer);
20 |
21 | CITestStreamFilter::removeErrorFilter();
22 |
23 | $this->assertSame('file_put_contents(./assets/versions.json): Failed to open stream: No such file or directory', $output);
24 | }
25 |
26 | public function testRun(): void
27 | {
28 | $this->setMinifierConfig();
29 |
30 | CITestStreamFilter::registration();
31 | CITestStreamFilter::addOutputFilter();
32 |
33 | $this->assertNotFalse(command('minify:css'));
34 | $this->parseOutput(CITestStreamFilter::$buffer);
35 |
36 | CITestStreamFilter::removeOutputFilter();
37 |
38 | $this->assertSame('CSS files were successfully generated.', $this->getLine(1));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/tests/Commands/MinifyJsTest.php:
--------------------------------------------------------------------------------
1 | assertNotFalse(command('minify:js'));
19 | $output = $this->parseOutput(CITestStreamFilter::$buffer);
20 |
21 | CITestStreamFilter::removeErrorFilter();
22 |
23 | $this->assertSame('file_put_contents(./assets/versions.json): Failed to open stream: No such file or directory', $output);
24 | }
25 |
26 | public function testRun(): void
27 | {
28 | $this->setMinifierConfig();
29 |
30 | CITestStreamFilter::registration();
31 | CITestStreamFilter::addOutputFilter();
32 |
33 | $this->assertNotFalse(command('minify:js'));
34 | $this->parseOutput(CITestStreamFilter::$buffer);
35 |
36 | CITestStreamFilter::removeOutputFilter();
37 |
38 | $this->assertSame('JS files were successfully generated.', $this->getLine(1));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/tests/Commands/MinifyPublishTest.php:
--------------------------------------------------------------------------------
1 | assertNotFalse(command('minify:publish'));
19 | $output = $this->parseOutput(CITestStreamFilter::$buffer);
20 |
21 | CITestStreamFilter::removeOutputFilter();
22 |
23 | $this->assertSame(' Published! You can customize the configuration by editing the "app/Config/Minifier.php" file.', $output);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/MinifierTest.php:
--------------------------------------------------------------------------------
1 | '0809aec7f61adfe412ca61ccaf138f5a',
19 | 'css' => 'f5e8f62a0635f68cd0eb6b85056c1f3d',
20 | ];
21 |
22 | protected function setUp(): void
23 | {
24 | parent::setUp();
25 |
26 | $this->config = new MinifierConfig();
27 |
28 | $this->config->baseUrl = 'http://localhost/';
29 | $this->config->dirJs = SUPPORTPATH . 'assets/js';
30 | $this->config->dirCss = SUPPORTPATH . 'assets/css';
31 | $this->config->dirMinJs = SUPPORTPATH . 'assets/js';
32 | $this->config->dirMinCss = SUPPORTPATH . 'assets/css';
33 | $this->config->dirVersion = SUPPORTPATH . 'assets';
34 | $this->config->js = ['all.min.js' => ['bootstrap.js', 'jquery-3.7.1.js', 'main.js']];
35 | $this->config->css = ['all.min.css' => ['bootstrap.css', 'font-awesome.css', 'main.css']];
36 |
37 | if (file_exists($this->config->dirJs . '/new.js')) {
38 | unlink($this->config->dirJs . '/new.js');
39 | }
40 |
41 | if (file_exists($this->config->dirCss . '/new.css')) {
42 | unlink($this->config->dirCss . '/new.css');
43 | }
44 |
45 | // if (file_exists($this->config->dirVersion . '/versions.js'))
46 | // {
47 | // unlink($this->config->dirVersion . '/versions.js');
48 | // }
49 | }
50 |
51 | public function testConfig()
52 | {
53 | $this->assertInstanceOf(MinifierConfig::class, $this->config);
54 |
55 | $this->assertSame('', $this->config->tagJs);
56 | $this->assertSame('', $this->config->tagCss);
57 |
58 | $this->assertSame(['all.min.js' => ['bootstrap.js', 'jquery-3.7.1.js', 'main.js']], $this->config->js);
59 | $this->assertSame(['all.min.css' => ['bootstrap.css', 'font-awesome.css', 'main.css']], $this->config->css);
60 | }
61 |
62 | public function testDeployExceptionForIncorrectDeploymentMode()
63 | {
64 | $this->expectException(MinifierException::class);
65 | $this->expectExceptionMessage('The "incorrect" is not correct deployment mode');
66 |
67 | $this->minifier = new Minifier($this->config);
68 |
69 | $this->minifier->deploy('incorrect');
70 | }
71 |
72 | public function testLoadExceptionForMissingVersioningFile()
73 | {
74 | $this->expectException(MinifierException::class);
75 | $this->expectExceptionMessage('There is no file with versioning. Run "php spark minify:all');
76 |
77 | if (file_exists($this->config->dirVersion . '/versions.json')) {
78 | unlink($this->config->dirVersion . '/versions.json');
79 | }
80 |
81 | $this->minifier = new Minifier($this->config);
82 |
83 | $this->minifier->load('all.min.css');
84 | }
85 |
86 | public function testLoadExceptionForWrongFileExtension()
87 | {
88 | $this->expectException(MinifierException::class);
89 | $this->expectExceptionMessage('Wrong file extension: ".php".');
90 |
91 | $this->minifier = new Minifier($this->config);
92 |
93 | $this->minifier->load('all.min.php');
94 | }
95 |
96 | public function testDeployJs()
97 | {
98 | $this->minifier = new Minifier($this->config);
99 |
100 | $result = $this->minifier->deploy('js');
101 |
102 | $this->assertTrue($result);
103 |
104 | $this->assertFileExists($this->config->dirJs . DIRECTORY_SEPARATOR . array_key_first($this->config->js));
105 | }
106 |
107 | public function testDeployCss()
108 | {
109 | $this->minifier = new Minifier($this->config);
110 |
111 | $result = $this->minifier->deploy('css');
112 |
113 | $this->assertTrue($result);
114 |
115 | $this->assertFileExists($this->config->dirCss . DIRECTORY_SEPARATOR . array_key_first($this->config->css));
116 | }
117 |
118 | public function testDeployAll()
119 | {
120 | $this->minifier = new Minifier($this->config);
121 |
122 | $result = $this->minifier->deploy('all');
123 |
124 | $this->assertTrue($result);
125 |
126 | $this->assertFileExists($this->config->dirJs . DIRECTORY_SEPARATOR . array_key_first($this->config->js));
127 | $this->assertFileExists($this->config->dirCss . DIRECTORY_SEPARATOR . array_key_first($this->config->css));
128 | }
129 |
130 | public function testLoadJs()
131 | {
132 | $this->minifier = new Minifier($this->config);
133 |
134 | $result = $this->minifier->load('all.min.js');
135 |
136 | $this->assertSame('' . PHP_EOL, $result);
137 | }
138 |
139 | public function testLoadCss()
140 | {
141 | $this->minifier = new Minifier($this->config);
142 |
143 | $result = $this->minifier->load('all.min.css');
144 |
145 | $this->assertSame('' . PHP_EOL, $result);
146 | }
147 |
148 | public function testLoadJsWithDirMinJs()
149 | {
150 | $this->config->dirMinJs = SUPPORTPATH . 'public/js';
151 | $this->minifier = new Minifier($this->config);
152 |
153 | $result = $this->minifier->load('all.min.js');
154 |
155 | $this->assertSame('' . PHP_EOL, $result);
156 | }
157 |
158 | public function testLoadCssWithDirMinCss()
159 | {
160 | $this->config->dirMinCss = SUPPORTPATH . 'public/css';
161 | $this->minifier = new Minifier($this->config);
162 |
163 | $result = $this->minifier->load('all.min.css');
164 |
165 | $this->assertSame('' . PHP_EOL, $result);
166 | }
167 |
168 | public function testLoadJsWithBaseJsUrl()
169 | {
170 | $this->config->baseJsUrl = 'http://js.localhost/';
171 |
172 | $this->minifier = new Minifier($this->config);
173 |
174 | $result = $this->minifier->load('all.min.js');
175 |
176 | $this->assertSame('' . PHP_EOL, $result);
177 | }
178 |
179 | public function testLoadCssWithBaseCssUrl()
180 | {
181 | $this->config->baseCssUrl = 'http://css.localhost/';
182 |
183 | $this->minifier = new Minifier($this->config);
184 |
185 | $result = $this->minifier->load('all.min.css');
186 |
187 | $this->assertSame('' . PHP_EOL, $result);
188 | }
189 |
190 | public function testLoadJsWithBaseJsUrlAndDirMinJs()
191 | {
192 | $this->config->baseJsUrl = 'http://js.localhost/';
193 | $this->config->dirMinJs = SUPPORTPATH . 'public/js';
194 |
195 | $this->minifier = new Minifier($this->config);
196 |
197 | $result = $this->minifier->load('all.min.js');
198 |
199 | $this->assertSame('' . PHP_EOL, $result);
200 | }
201 |
202 | public function testLoadCssWithBaseCssUrlAndDirMinCss()
203 | {
204 | $this->config->baseCssUrl = 'http://css.localhost/';
205 | $this->config->dirMinCss = SUPPORTPATH . 'public/css';
206 |
207 | $this->minifier = new Minifier($this->config);
208 |
209 | $result = $this->minifier->load('all.min.css');
210 |
211 | $this->assertSame('' . PHP_EOL, $result);
212 | }
213 |
214 | public function testJsonReturnTypeWithLoadJs()
215 | {
216 | $this->config->returnType = 'json';
217 | $this->minifier = new Minifier($this->config);
218 |
219 | $result = $this->minifier->load('all.min.js');
220 |
221 | $this->assertSame(json_encode(['http://localhost' . SUPPORTPATH . 'assets/js/all.min.js?v=' . $this->ver['js']]), $result);
222 | }
223 |
224 | public function testJsonReturnTypeWithLoadCss()
225 | {
226 | $this->config->returnType = 'json';
227 | $this->minifier = new Minifier($this->config);
228 |
229 | $result = $this->minifier->load('all.min.css');
230 |
231 | $this->assertSame(json_encode(['http://localhost' . SUPPORTPATH . 'assets/css/all.min.css?v=' . $this->ver['css']]), $result);
232 | }
233 |
234 | public function testArrayReturnTypeWithLoadJs()
235 | {
236 | $this->config->returnType = 'array';
237 | $this->minifier = new Minifier($this->config);
238 |
239 | $result = $this->minifier->load('all.min.js');
240 |
241 | $this->assertSame(['http://localhost' . SUPPORTPATH . 'assets/js/all.min.js?v=' . $this->ver['js']], $result);
242 | }
243 |
244 | public function testArrayReturnTypeWithLoadCss()
245 | {
246 | $this->config->returnType = 'array';
247 | $this->minifier = new Minifier($this->config);
248 |
249 | $result = $this->minifier->load('all.min.css');
250 |
251 | $this->assertSame(['http://localhost' . SUPPORTPATH . 'assets/css/all.min.css?v=' . $this->ver['css']], $result);
252 | }
253 |
254 | public function testLoadExceptionForWrongReturnType()
255 | {
256 | $this->expectException(MinifierException::class);
257 | $this->expectExceptionMessage('The "php" is not correct return type.');
258 |
259 | $this->config->returnType = 'php';
260 | $this->minifier = new Minifier($this->config);
261 |
262 | $this->minifier->load('all.min.css');
263 | }
264 |
265 | public function testDeployJsWithDirMinJs()
266 | {
267 | if (file_exists($this->config->dirMinJs . '/all.min.js')) {
268 | unlink($this->config->dirMinJs . '/all.min.js');
269 | }
270 |
271 | $this->config->dirMinJs = SUPPORTPATH . 'public/js';
272 | $this->minifier = new Minifier($this->config);
273 |
274 | $result = $this->minifier->deploy('js');
275 |
276 | $this->assertTrue($result);
277 |
278 | $this->assertFileExists($this->config->dirMinJs . DIRECTORY_SEPARATOR . array_key_first($this->config->js));
279 | }
280 |
281 | public function testDeployCssWithDirMinCss()
282 | {
283 | if (file_exists($this->config->dirMinCss . '/all.min.css')) {
284 | unlink($this->config->dirMinCss . '/all.min.css');
285 | }
286 |
287 | $this->config->dirMinCss = SUPPORTPATH . 'public/css';
288 | $this->minifier = new Minifier($this->config);
289 |
290 | $result = $this->minifier->deploy('css');
291 |
292 | $this->assertTrue($result);
293 |
294 | $this->assertFileExists($this->config->dirMinCss . DIRECTORY_SEPARATOR . array_key_first($this->config->css));
295 | }
296 |
297 | public function testDeployAllWithDirMinJsAndCss()
298 | {
299 | if (file_exists($this->config->dirMinJs . '/all.min.js')) {
300 | unlink($this->config->dirMinJs . '/all.min.js');
301 | }
302 |
303 | if (file_exists($this->config->dirMinCss . '/all.min.css')) {
304 | unlink($this->config->dirMinCss . '/all.min.css');
305 | }
306 |
307 | $this->config->dirMinJs = SUPPORTPATH . 'public/js';
308 | $this->config->dirMinCss = SUPPORTPATH . 'public/css';
309 | $this->minifier = new Minifier($this->config);
310 |
311 | $result = $this->minifier->deploy();
312 |
313 | $this->assertTrue($result);
314 |
315 | $this->assertFileExists($this->config->dirMinJs . DIRECTORY_SEPARATOR . array_key_first($this->config->js));
316 | $this->assertFileExists($this->config->dirMinCss . DIRECTORY_SEPARATOR . array_key_first($this->config->css));
317 | }
318 |
319 | public function testAutoDeployOnChange()
320 | {
321 | $this->config->returnType = 'array';
322 | $this->config->autoDeployOnChange = true;
323 | $this->minifier = new Minifier($this->config);
324 |
325 | $filePath = SUPPORTPATH . 'assets' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'main.js';
326 | $backup = file_get_contents($filePath);
327 | file_put_contents($filePath, 'jsData = "test";');
328 |
329 | $result = $this->minifier->load('all.min.js');
330 | $this->assertSame(['http://localhost' . SUPPORTPATH . 'assets/js/all.min.js?v=0809aec7f61adfe412ca61ccaf138f5a'], $result);
331 |
332 | file_put_contents($filePath, $backup);
333 | }
334 | }
335 |
--------------------------------------------------------------------------------
/tests/_support/CLITestCase.php:
--------------------------------------------------------------------------------
1 | lines = [];
18 | $output = $this->removeColorCodes($output);
19 | $this->lines = explode("\n", $output);
20 |
21 | return $output;
22 | }
23 |
24 | protected function getLine(int $line = 0): ?string
25 | {
26 | return $this->lines[$line] ?? null;
27 | }
28 |
29 | protected function getLines(): string
30 | {
31 | return implode('', $this->lines);
32 | }
33 |
34 | protected function removeColorCodes(string $output): string
35 | {
36 | $colors = $this->getPrivateProperty(CLI::class, 'foreground_colors');
37 | $colors = array_values(array_map(static fn ($color) => "\033[" . $color . 'm', $colors));
38 | $colors = ["\033[0m", ...$colors];
39 |
40 | $output = str_replace($colors, '', trim($output));
41 |
42 | if (is_windows()) {
43 | $output = str_replace("\r\n", "\n", $output);
44 | }
45 |
46 | return $output;
47 | }
48 |
49 | protected function setMinifierConfig()
50 | {
51 | $config = config(MinifierConfig::class);
52 | $config->dirJs = SUPPORTPATH . 'assets/js';
53 | $config->dirCss = SUPPORTPATH . 'assets/css';
54 | $config->dirMinJs = SUPPORTPATH . 'assets/js';
55 | $config->dirMinCss = SUPPORTPATH . 'assets/css';
56 | $config->dirVersion = SUPPORTPATH . 'assets';
57 | $config->js = ['all.min.js' => ['bootstrap.js', 'jquery-3.7.1.js', 'main.js']];
58 | $config->css = ['all.min.css' => ['bootstrap.css', 'font-awesome.css', 'main.css']];
59 |
60 | service('minifier', $config);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/tests/_support/TestCase.php:
--------------------------------------------------------------------------------
1 | resetServices();
12 |
13 | parent::setUp();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tests/_support/assets/css/font-awesome.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 | /* FONT PATH
6 | * -------------------------- */
7 | @font-face {
8 | font-family: 'FontAwesome';
9 | src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
10 | src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
11 | font-weight: normal;
12 | font-style: normal;
13 | }
14 | .fa {
15 | display: inline-block;
16 | font: normal normal normal 14px/1 FontAwesome;
17 | font-size: inherit;
18 | text-rendering: auto;
19 | -webkit-font-smoothing: antialiased;
20 | -moz-osx-font-smoothing: grayscale;
21 | }
22 | /* makes the font 33% larger relative to the icon container */
23 | .fa-lg {
24 | font-size: 1.33333333em;
25 | line-height: 0.75em;
26 | vertical-align: -15%;
27 | }
28 | .fa-2x {
29 | font-size: 2em;
30 | }
31 | .fa-3x {
32 | font-size: 3em;
33 | }
34 | .fa-4x {
35 | font-size: 4em;
36 | }
37 | .fa-5x {
38 | font-size: 5em;
39 | }
40 | .fa-fw {
41 | width: 1.28571429em;
42 | text-align: center;
43 | }
44 | .fa-ul {
45 | padding-left: 0;
46 | margin-left: 2.14285714em;
47 | list-style-type: none;
48 | }
49 | .fa-ul > li {
50 | position: relative;
51 | }
52 | .fa-li {
53 | position: absolute;
54 | left: -2.14285714em;
55 | width: 2.14285714em;
56 | top: 0.14285714em;
57 | text-align: center;
58 | }
59 | .fa-li.fa-lg {
60 | left: -1.85714286em;
61 | }
62 | .fa-border {
63 | padding: .2em .25em .15em;
64 | border: solid 0.08em #eeeeee;
65 | border-radius: .1em;
66 | }
67 | .fa-pull-left {
68 | float: left;
69 | }
70 | .fa-pull-right {
71 | float: right;
72 | }
73 | .fa.fa-pull-left {
74 | margin-right: .3em;
75 | }
76 | .fa.fa-pull-right {
77 | margin-left: .3em;
78 | }
79 | /* Deprecated as of 4.4.0 */
80 | .pull-right {
81 | float: right;
82 | }
83 | .pull-left {
84 | float: left;
85 | }
86 | .fa.pull-left {
87 | margin-right: .3em;
88 | }
89 | .fa.pull-right {
90 | margin-left: .3em;
91 | }
92 | .fa-spin {
93 | -webkit-animation: fa-spin 2s infinite linear;
94 | animation: fa-spin 2s infinite linear;
95 | }
96 | .fa-pulse {
97 | -webkit-animation: fa-spin 1s infinite steps(8);
98 | animation: fa-spin 1s infinite steps(8);
99 | }
100 | @-webkit-keyframes fa-spin {
101 | 0% {
102 | -webkit-transform: rotate(0deg);
103 | transform: rotate(0deg);
104 | }
105 | 100% {
106 | -webkit-transform: rotate(359deg);
107 | transform: rotate(359deg);
108 | }
109 | }
110 | @keyframes fa-spin {
111 | 0% {
112 | -webkit-transform: rotate(0deg);
113 | transform: rotate(0deg);
114 | }
115 | 100% {
116 | -webkit-transform: rotate(359deg);
117 | transform: rotate(359deg);
118 | }
119 | }
120 | .fa-rotate-90 {
121 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
122 | -webkit-transform: rotate(90deg);
123 | -ms-transform: rotate(90deg);
124 | transform: rotate(90deg);
125 | }
126 | .fa-rotate-180 {
127 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
128 | -webkit-transform: rotate(180deg);
129 | -ms-transform: rotate(180deg);
130 | transform: rotate(180deg);
131 | }
132 | .fa-rotate-270 {
133 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
134 | -webkit-transform: rotate(270deg);
135 | -ms-transform: rotate(270deg);
136 | transform: rotate(270deg);
137 | }
138 | .fa-flip-horizontal {
139 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
140 | -webkit-transform: scale(-1, 1);
141 | -ms-transform: scale(-1, 1);
142 | transform: scale(-1, 1);
143 | }
144 | .fa-flip-vertical {
145 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
146 | -webkit-transform: scale(1, -1);
147 | -ms-transform: scale(1, -1);
148 | transform: scale(1, -1);
149 | }
150 | :root .fa-rotate-90,
151 | :root .fa-rotate-180,
152 | :root .fa-rotate-270,
153 | :root .fa-flip-horizontal,
154 | :root .fa-flip-vertical {
155 | filter: none;
156 | }
157 | .fa-stack {
158 | position: relative;
159 | display: inline-block;
160 | width: 2em;
161 | height: 2em;
162 | line-height: 2em;
163 | vertical-align: middle;
164 | }
165 | .fa-stack-1x,
166 | .fa-stack-2x {
167 | position: absolute;
168 | left: 0;
169 | width: 100%;
170 | text-align: center;
171 | }
172 | .fa-stack-1x {
173 | line-height: inherit;
174 | }
175 | .fa-stack-2x {
176 | font-size: 2em;
177 | }
178 | .fa-inverse {
179 | color: #ffffff;
180 | }
181 | /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
182 | readers do not read off random characters that represent icons */
183 | .fa-glass:before {
184 | content: "\f000";
185 | }
186 | .fa-music:before {
187 | content: "\f001";
188 | }
189 | .fa-search:before {
190 | content: "\f002";
191 | }
192 | .fa-envelope-o:before {
193 | content: "\f003";
194 | }
195 | .fa-heart:before {
196 | content: "\f004";
197 | }
198 | .fa-star:before {
199 | content: "\f005";
200 | }
201 | .fa-star-o:before {
202 | content: "\f006";
203 | }
204 | .fa-user:before {
205 | content: "\f007";
206 | }
207 | .fa-film:before {
208 | content: "\f008";
209 | }
210 | .fa-th-large:before {
211 | content: "\f009";
212 | }
213 | .fa-th:before {
214 | content: "\f00a";
215 | }
216 | .fa-th-list:before {
217 | content: "\f00b";
218 | }
219 | .fa-check:before {
220 | content: "\f00c";
221 | }
222 | .fa-remove:before,
223 | .fa-close:before,
224 | .fa-times:before {
225 | content: "\f00d";
226 | }
227 | .fa-search-plus:before {
228 | content: "\f00e";
229 | }
230 | .fa-search-minus:before {
231 | content: "\f010";
232 | }
233 | .fa-power-off:before {
234 | content: "\f011";
235 | }
236 | .fa-signal:before {
237 | content: "\f012";
238 | }
239 | .fa-gear:before,
240 | .fa-cog:before {
241 | content: "\f013";
242 | }
243 | .fa-trash-o:before {
244 | content: "\f014";
245 | }
246 | .fa-home:before {
247 | content: "\f015";
248 | }
249 | .fa-file-o:before {
250 | content: "\f016";
251 | }
252 | .fa-clock-o:before {
253 | content: "\f017";
254 | }
255 | .fa-road:before {
256 | content: "\f018";
257 | }
258 | .fa-download:before {
259 | content: "\f019";
260 | }
261 | .fa-arrow-circle-o-down:before {
262 | content: "\f01a";
263 | }
264 | .fa-arrow-circle-o-up:before {
265 | content: "\f01b";
266 | }
267 | .fa-inbox:before {
268 | content: "\f01c";
269 | }
270 | .fa-play-circle-o:before {
271 | content: "\f01d";
272 | }
273 | .fa-rotate-right:before,
274 | .fa-repeat:before {
275 | content: "\f01e";
276 | }
277 | .fa-refresh:before {
278 | content: "\f021";
279 | }
280 | .fa-list-alt:before {
281 | content: "\f022";
282 | }
283 | .fa-lock:before {
284 | content: "\f023";
285 | }
286 | .fa-flag:before {
287 | content: "\f024";
288 | }
289 | .fa-headphones:before {
290 | content: "\f025";
291 | }
292 | .fa-volume-off:before {
293 | content: "\f026";
294 | }
295 | .fa-volume-down:before {
296 | content: "\f027";
297 | }
298 | .fa-volume-up:before {
299 | content: "\f028";
300 | }
301 | .fa-qrcode:before {
302 | content: "\f029";
303 | }
304 | .fa-barcode:before {
305 | content: "\f02a";
306 | }
307 | .fa-tag:before {
308 | content: "\f02b";
309 | }
310 | .fa-tags:before {
311 | content: "\f02c";
312 | }
313 | .fa-book:before {
314 | content: "\f02d";
315 | }
316 | .fa-bookmark:before {
317 | content: "\f02e";
318 | }
319 | .fa-print:before {
320 | content: "\f02f";
321 | }
322 | .fa-camera:before {
323 | content: "\f030";
324 | }
325 | .fa-font:before {
326 | content: "\f031";
327 | }
328 | .fa-bold:before {
329 | content: "\f032";
330 | }
331 | .fa-italic:before {
332 | content: "\f033";
333 | }
334 | .fa-text-height:before {
335 | content: "\f034";
336 | }
337 | .fa-text-width:before {
338 | content: "\f035";
339 | }
340 | .fa-align-left:before {
341 | content: "\f036";
342 | }
343 | .fa-align-center:before {
344 | content: "\f037";
345 | }
346 | .fa-align-right:before {
347 | content: "\f038";
348 | }
349 | .fa-align-justify:before {
350 | content: "\f039";
351 | }
352 | .fa-list:before {
353 | content: "\f03a";
354 | }
355 | .fa-dedent:before,
356 | .fa-outdent:before {
357 | content: "\f03b";
358 | }
359 | .fa-indent:before {
360 | content: "\f03c";
361 | }
362 | .fa-video-camera:before {
363 | content: "\f03d";
364 | }
365 | .fa-photo:before,
366 | .fa-image:before,
367 | .fa-picture-o:before {
368 | content: "\f03e";
369 | }
370 | .fa-pencil:before {
371 | content: "\f040";
372 | }
373 | .fa-map-marker:before {
374 | content: "\f041";
375 | }
376 | .fa-adjust:before {
377 | content: "\f042";
378 | }
379 | .fa-tint:before {
380 | content: "\f043";
381 | }
382 | .fa-edit:before,
383 | .fa-pencil-square-o:before {
384 | content: "\f044";
385 | }
386 | .fa-share-square-o:before {
387 | content: "\f045";
388 | }
389 | .fa-check-square-o:before {
390 | content: "\f046";
391 | }
392 | .fa-arrows:before {
393 | content: "\f047";
394 | }
395 | .fa-step-backward:before {
396 | content: "\f048";
397 | }
398 | .fa-fast-backward:before {
399 | content: "\f049";
400 | }
401 | .fa-backward:before {
402 | content: "\f04a";
403 | }
404 | .fa-play:before {
405 | content: "\f04b";
406 | }
407 | .fa-pause:before {
408 | content: "\f04c";
409 | }
410 | .fa-stop:before {
411 | content: "\f04d";
412 | }
413 | .fa-forward:before {
414 | content: "\f04e";
415 | }
416 | .fa-fast-forward:before {
417 | content: "\f050";
418 | }
419 | .fa-step-forward:before {
420 | content: "\f051";
421 | }
422 | .fa-eject:before {
423 | content: "\f052";
424 | }
425 | .fa-chevron-left:before {
426 | content: "\f053";
427 | }
428 | .fa-chevron-right:before {
429 | content: "\f054";
430 | }
431 | .fa-plus-circle:before {
432 | content: "\f055";
433 | }
434 | .fa-minus-circle:before {
435 | content: "\f056";
436 | }
437 | .fa-times-circle:before {
438 | content: "\f057";
439 | }
440 | .fa-check-circle:before {
441 | content: "\f058";
442 | }
443 | .fa-question-circle:before {
444 | content: "\f059";
445 | }
446 | .fa-info-circle:before {
447 | content: "\f05a";
448 | }
449 | .fa-crosshairs:before {
450 | content: "\f05b";
451 | }
452 | .fa-times-circle-o:before {
453 | content: "\f05c";
454 | }
455 | .fa-check-circle-o:before {
456 | content: "\f05d";
457 | }
458 | .fa-ban:before {
459 | content: "\f05e";
460 | }
461 | .fa-arrow-left:before {
462 | content: "\f060";
463 | }
464 | .fa-arrow-right:before {
465 | content: "\f061";
466 | }
467 | .fa-arrow-up:before {
468 | content: "\f062";
469 | }
470 | .fa-arrow-down:before {
471 | content: "\f063";
472 | }
473 | .fa-mail-forward:before,
474 | .fa-share:before {
475 | content: "\f064";
476 | }
477 | .fa-expand:before {
478 | content: "\f065";
479 | }
480 | .fa-compress:before {
481 | content: "\f066";
482 | }
483 | .fa-plus:before {
484 | content: "\f067";
485 | }
486 | .fa-minus:before {
487 | content: "\f068";
488 | }
489 | .fa-asterisk:before {
490 | content: "\f069";
491 | }
492 | .fa-exclamation-circle:before {
493 | content: "\f06a";
494 | }
495 | .fa-gift:before {
496 | content: "\f06b";
497 | }
498 | .fa-leaf:before {
499 | content: "\f06c";
500 | }
501 | .fa-fire:before {
502 | content: "\f06d";
503 | }
504 | .fa-eye:before {
505 | content: "\f06e";
506 | }
507 | .fa-eye-slash:before {
508 | content: "\f070";
509 | }
510 | .fa-warning:before,
511 | .fa-exclamation-triangle:before {
512 | content: "\f071";
513 | }
514 | .fa-plane:before {
515 | content: "\f072";
516 | }
517 | .fa-calendar:before {
518 | content: "\f073";
519 | }
520 | .fa-random:before {
521 | content: "\f074";
522 | }
523 | .fa-comment:before {
524 | content: "\f075";
525 | }
526 | .fa-magnet:before {
527 | content: "\f076";
528 | }
529 | .fa-chevron-up:before {
530 | content: "\f077";
531 | }
532 | .fa-chevron-down:before {
533 | content: "\f078";
534 | }
535 | .fa-retweet:before {
536 | content: "\f079";
537 | }
538 | .fa-shopping-cart:before {
539 | content: "\f07a";
540 | }
541 | .fa-folder:before {
542 | content: "\f07b";
543 | }
544 | .fa-folder-open:before {
545 | content: "\f07c";
546 | }
547 | .fa-arrows-v:before {
548 | content: "\f07d";
549 | }
550 | .fa-arrows-h:before {
551 | content: "\f07e";
552 | }
553 | .fa-bar-chart-o:before,
554 | .fa-bar-chart:before {
555 | content: "\f080";
556 | }
557 | .fa-twitter-square:before {
558 | content: "\f081";
559 | }
560 | .fa-facebook-square:before {
561 | content: "\f082";
562 | }
563 | .fa-camera-retro:before {
564 | content: "\f083";
565 | }
566 | .fa-key:before {
567 | content: "\f084";
568 | }
569 | .fa-gears:before,
570 | .fa-cogs:before {
571 | content: "\f085";
572 | }
573 | .fa-comments:before {
574 | content: "\f086";
575 | }
576 | .fa-thumbs-o-up:before {
577 | content: "\f087";
578 | }
579 | .fa-thumbs-o-down:before {
580 | content: "\f088";
581 | }
582 | .fa-star-half:before {
583 | content: "\f089";
584 | }
585 | .fa-heart-o:before {
586 | content: "\f08a";
587 | }
588 | .fa-sign-out:before {
589 | content: "\f08b";
590 | }
591 | .fa-linkedin-square:before {
592 | content: "\f08c";
593 | }
594 | .fa-thumb-tack:before {
595 | content: "\f08d";
596 | }
597 | .fa-external-link:before {
598 | content: "\f08e";
599 | }
600 | .fa-sign-in:before {
601 | content: "\f090";
602 | }
603 | .fa-trophy:before {
604 | content: "\f091";
605 | }
606 | .fa-github-square:before {
607 | content: "\f092";
608 | }
609 | .fa-upload:before {
610 | content: "\f093";
611 | }
612 | .fa-lemon-o:before {
613 | content: "\f094";
614 | }
615 | .fa-phone:before {
616 | content: "\f095";
617 | }
618 | .fa-square-o:before {
619 | content: "\f096";
620 | }
621 | .fa-bookmark-o:before {
622 | content: "\f097";
623 | }
624 | .fa-phone-square:before {
625 | content: "\f098";
626 | }
627 | .fa-twitter:before {
628 | content: "\f099";
629 | }
630 | .fa-facebook-f:before,
631 | .fa-facebook:before {
632 | content: "\f09a";
633 | }
634 | .fa-github:before {
635 | content: "\f09b";
636 | }
637 | .fa-unlock:before {
638 | content: "\f09c";
639 | }
640 | .fa-credit-card:before {
641 | content: "\f09d";
642 | }
643 | .fa-feed:before,
644 | .fa-rss:before {
645 | content: "\f09e";
646 | }
647 | .fa-hdd-o:before {
648 | content: "\f0a0";
649 | }
650 | .fa-bullhorn:before {
651 | content: "\f0a1";
652 | }
653 | .fa-bell:before {
654 | content: "\f0f3";
655 | }
656 | .fa-certificate:before {
657 | content: "\f0a3";
658 | }
659 | .fa-hand-o-right:before {
660 | content: "\f0a4";
661 | }
662 | .fa-hand-o-left:before {
663 | content: "\f0a5";
664 | }
665 | .fa-hand-o-up:before {
666 | content: "\f0a6";
667 | }
668 | .fa-hand-o-down:before {
669 | content: "\f0a7";
670 | }
671 | .fa-arrow-circle-left:before {
672 | content: "\f0a8";
673 | }
674 | .fa-arrow-circle-right:before {
675 | content: "\f0a9";
676 | }
677 | .fa-arrow-circle-up:before {
678 | content: "\f0aa";
679 | }
680 | .fa-arrow-circle-down:before {
681 | content: "\f0ab";
682 | }
683 | .fa-globe:before {
684 | content: "\f0ac";
685 | }
686 | .fa-wrench:before {
687 | content: "\f0ad";
688 | }
689 | .fa-tasks:before {
690 | content: "\f0ae";
691 | }
692 | .fa-filter:before {
693 | content: "\f0b0";
694 | }
695 | .fa-briefcase:before {
696 | content: "\f0b1";
697 | }
698 | .fa-arrows-alt:before {
699 | content: "\f0b2";
700 | }
701 | .fa-group:before,
702 | .fa-users:before {
703 | content: "\f0c0";
704 | }
705 | .fa-chain:before,
706 | .fa-link:before {
707 | content: "\f0c1";
708 | }
709 | .fa-cloud:before {
710 | content: "\f0c2";
711 | }
712 | .fa-flask:before {
713 | content: "\f0c3";
714 | }
715 | .fa-cut:before,
716 | .fa-scissors:before {
717 | content: "\f0c4";
718 | }
719 | .fa-copy:before,
720 | .fa-files-o:before {
721 | content: "\f0c5";
722 | }
723 | .fa-paperclip:before {
724 | content: "\f0c6";
725 | }
726 | .fa-save:before,
727 | .fa-floppy-o:before {
728 | content: "\f0c7";
729 | }
730 | .fa-square:before {
731 | content: "\f0c8";
732 | }
733 | .fa-navicon:before,
734 | .fa-reorder:before,
735 | .fa-bars:before {
736 | content: "\f0c9";
737 | }
738 | .fa-list-ul:before {
739 | content: "\f0ca";
740 | }
741 | .fa-list-ol:before {
742 | content: "\f0cb";
743 | }
744 | .fa-strikethrough:before {
745 | content: "\f0cc";
746 | }
747 | .fa-underline:before {
748 | content: "\f0cd";
749 | }
750 | .fa-table:before {
751 | content: "\f0ce";
752 | }
753 | .fa-magic:before {
754 | content: "\f0d0";
755 | }
756 | .fa-truck:before {
757 | content: "\f0d1";
758 | }
759 | .fa-pinterest:before {
760 | content: "\f0d2";
761 | }
762 | .fa-pinterest-square:before {
763 | content: "\f0d3";
764 | }
765 | .fa-google-plus-square:before {
766 | content: "\f0d4";
767 | }
768 | .fa-google-plus:before {
769 | content: "\f0d5";
770 | }
771 | .fa-money:before {
772 | content: "\f0d6";
773 | }
774 | .fa-caret-down:before {
775 | content: "\f0d7";
776 | }
777 | .fa-caret-up:before {
778 | content: "\f0d8";
779 | }
780 | .fa-caret-left:before {
781 | content: "\f0d9";
782 | }
783 | .fa-caret-right:before {
784 | content: "\f0da";
785 | }
786 | .fa-columns:before {
787 | content: "\f0db";
788 | }
789 | .fa-unsorted:before,
790 | .fa-sort:before {
791 | content: "\f0dc";
792 | }
793 | .fa-sort-down:before,
794 | .fa-sort-desc:before {
795 | content: "\f0dd";
796 | }
797 | .fa-sort-up:before,
798 | .fa-sort-asc:before {
799 | content: "\f0de";
800 | }
801 | .fa-envelope:before {
802 | content: "\f0e0";
803 | }
804 | .fa-linkedin:before {
805 | content: "\f0e1";
806 | }
807 | .fa-rotate-left:before,
808 | .fa-undo:before {
809 | content: "\f0e2";
810 | }
811 | .fa-legal:before,
812 | .fa-gavel:before {
813 | content: "\f0e3";
814 | }
815 | .fa-dashboard:before,
816 | .fa-tachometer:before {
817 | content: "\f0e4";
818 | }
819 | .fa-comment-o:before {
820 | content: "\f0e5";
821 | }
822 | .fa-comments-o:before {
823 | content: "\f0e6";
824 | }
825 | .fa-flash:before,
826 | .fa-bolt:before {
827 | content: "\f0e7";
828 | }
829 | .fa-sitemap:before {
830 | content: "\f0e8";
831 | }
832 | .fa-umbrella:before {
833 | content: "\f0e9";
834 | }
835 | .fa-paste:before,
836 | .fa-clipboard:before {
837 | content: "\f0ea";
838 | }
839 | .fa-lightbulb-o:before {
840 | content: "\f0eb";
841 | }
842 | .fa-exchange:before {
843 | content: "\f0ec";
844 | }
845 | .fa-cloud-download:before {
846 | content: "\f0ed";
847 | }
848 | .fa-cloud-upload:before {
849 | content: "\f0ee";
850 | }
851 | .fa-user-md:before {
852 | content: "\f0f0";
853 | }
854 | .fa-stethoscope:before {
855 | content: "\f0f1";
856 | }
857 | .fa-suitcase:before {
858 | content: "\f0f2";
859 | }
860 | .fa-bell-o:before {
861 | content: "\f0a2";
862 | }
863 | .fa-coffee:before {
864 | content: "\f0f4";
865 | }
866 | .fa-cutlery:before {
867 | content: "\f0f5";
868 | }
869 | .fa-file-text-o:before {
870 | content: "\f0f6";
871 | }
872 | .fa-building-o:before {
873 | content: "\f0f7";
874 | }
875 | .fa-hospital-o:before {
876 | content: "\f0f8";
877 | }
878 | .fa-ambulance:before {
879 | content: "\f0f9";
880 | }
881 | .fa-medkit:before {
882 | content: "\f0fa";
883 | }
884 | .fa-fighter-jet:before {
885 | content: "\f0fb";
886 | }
887 | .fa-beer:before {
888 | content: "\f0fc";
889 | }
890 | .fa-h-square:before {
891 | content: "\f0fd";
892 | }
893 | .fa-plus-square:before {
894 | content: "\f0fe";
895 | }
896 | .fa-angle-double-left:before {
897 | content: "\f100";
898 | }
899 | .fa-angle-double-right:before {
900 | content: "\f101";
901 | }
902 | .fa-angle-double-up:before {
903 | content: "\f102";
904 | }
905 | .fa-angle-double-down:before {
906 | content: "\f103";
907 | }
908 | .fa-angle-left:before {
909 | content: "\f104";
910 | }
911 | .fa-angle-right:before {
912 | content: "\f105";
913 | }
914 | .fa-angle-up:before {
915 | content: "\f106";
916 | }
917 | .fa-angle-down:before {
918 | content: "\f107";
919 | }
920 | .fa-desktop:before {
921 | content: "\f108";
922 | }
923 | .fa-laptop:before {
924 | content: "\f109";
925 | }
926 | .fa-tablet:before {
927 | content: "\f10a";
928 | }
929 | .fa-mobile-phone:before,
930 | .fa-mobile:before {
931 | content: "\f10b";
932 | }
933 | .fa-circle-o:before {
934 | content: "\f10c";
935 | }
936 | .fa-quote-left:before {
937 | content: "\f10d";
938 | }
939 | .fa-quote-right:before {
940 | content: "\f10e";
941 | }
942 | .fa-spinner:before {
943 | content: "\f110";
944 | }
945 | .fa-circle:before {
946 | content: "\f111";
947 | }
948 | .fa-mail-reply:before,
949 | .fa-reply:before {
950 | content: "\f112";
951 | }
952 | .fa-github-alt:before {
953 | content: "\f113";
954 | }
955 | .fa-folder-o:before {
956 | content: "\f114";
957 | }
958 | .fa-folder-open-o:before {
959 | content: "\f115";
960 | }
961 | .fa-smile-o:before {
962 | content: "\f118";
963 | }
964 | .fa-frown-o:before {
965 | content: "\f119";
966 | }
967 | .fa-meh-o:before {
968 | content: "\f11a";
969 | }
970 | .fa-gamepad:before {
971 | content: "\f11b";
972 | }
973 | .fa-keyboard-o:before {
974 | content: "\f11c";
975 | }
976 | .fa-flag-o:before {
977 | content: "\f11d";
978 | }
979 | .fa-flag-checkered:before {
980 | content: "\f11e";
981 | }
982 | .fa-terminal:before {
983 | content: "\f120";
984 | }
985 | .fa-code:before {
986 | content: "\f121";
987 | }
988 | .fa-mail-reply-all:before,
989 | .fa-reply-all:before {
990 | content: "\f122";
991 | }
992 | .fa-star-half-empty:before,
993 | .fa-star-half-full:before,
994 | .fa-star-half-o:before {
995 | content: "\f123";
996 | }
997 | .fa-location-arrow:before {
998 | content: "\f124";
999 | }
1000 | .fa-crop:before {
1001 | content: "\f125";
1002 | }
1003 | .fa-code-fork:before {
1004 | content: "\f126";
1005 | }
1006 | .fa-unlink:before,
1007 | .fa-chain-broken:before {
1008 | content: "\f127";
1009 | }
1010 | .fa-question:before {
1011 | content: "\f128";
1012 | }
1013 | .fa-info:before {
1014 | content: "\f129";
1015 | }
1016 | .fa-exclamation:before {
1017 | content: "\f12a";
1018 | }
1019 | .fa-superscript:before {
1020 | content: "\f12b";
1021 | }
1022 | .fa-subscript:before {
1023 | content: "\f12c";
1024 | }
1025 | .fa-eraser:before {
1026 | content: "\f12d";
1027 | }
1028 | .fa-puzzle-piece:before {
1029 | content: "\f12e";
1030 | }
1031 | .fa-microphone:before {
1032 | content: "\f130";
1033 | }
1034 | .fa-microphone-slash:before {
1035 | content: "\f131";
1036 | }
1037 | .fa-shield:before {
1038 | content: "\f132";
1039 | }
1040 | .fa-calendar-o:before {
1041 | content: "\f133";
1042 | }
1043 | .fa-fire-extinguisher:before {
1044 | content: "\f134";
1045 | }
1046 | .fa-rocket:before {
1047 | content: "\f135";
1048 | }
1049 | .fa-maxcdn:before {
1050 | content: "\f136";
1051 | }
1052 | .fa-chevron-circle-left:before {
1053 | content: "\f137";
1054 | }
1055 | .fa-chevron-circle-right:before {
1056 | content: "\f138";
1057 | }
1058 | .fa-chevron-circle-up:before {
1059 | content: "\f139";
1060 | }
1061 | .fa-chevron-circle-down:before {
1062 | content: "\f13a";
1063 | }
1064 | .fa-html5:before {
1065 | content: "\f13b";
1066 | }
1067 | .fa-css3:before {
1068 | content: "\f13c";
1069 | }
1070 | .fa-anchor:before {
1071 | content: "\f13d";
1072 | }
1073 | .fa-unlock-alt:before {
1074 | content: "\f13e";
1075 | }
1076 | .fa-bullseye:before {
1077 | content: "\f140";
1078 | }
1079 | .fa-ellipsis-h:before {
1080 | content: "\f141";
1081 | }
1082 | .fa-ellipsis-v:before {
1083 | content: "\f142";
1084 | }
1085 | .fa-rss-square:before {
1086 | content: "\f143";
1087 | }
1088 | .fa-play-circle:before {
1089 | content: "\f144";
1090 | }
1091 | .fa-ticket:before {
1092 | content: "\f145";
1093 | }
1094 | .fa-minus-square:before {
1095 | content: "\f146";
1096 | }
1097 | .fa-minus-square-o:before {
1098 | content: "\f147";
1099 | }
1100 | .fa-level-up:before {
1101 | content: "\f148";
1102 | }
1103 | .fa-level-down:before {
1104 | content: "\f149";
1105 | }
1106 | .fa-check-square:before {
1107 | content: "\f14a";
1108 | }
1109 | .fa-pencil-square:before {
1110 | content: "\f14b";
1111 | }
1112 | .fa-external-link-square:before {
1113 | content: "\f14c";
1114 | }
1115 | .fa-share-square:before {
1116 | content: "\f14d";
1117 | }
1118 | .fa-compass:before {
1119 | content: "\f14e";
1120 | }
1121 | .fa-toggle-down:before,
1122 | .fa-caret-square-o-down:before {
1123 | content: "\f150";
1124 | }
1125 | .fa-toggle-up:before,
1126 | .fa-caret-square-o-up:before {
1127 | content: "\f151";
1128 | }
1129 | .fa-toggle-right:before,
1130 | .fa-caret-square-o-right:before {
1131 | content: "\f152";
1132 | }
1133 | .fa-euro:before,
1134 | .fa-eur:before {
1135 | content: "\f153";
1136 | }
1137 | .fa-gbp:before {
1138 | content: "\f154";
1139 | }
1140 | .fa-dollar:before,
1141 | .fa-usd:before {
1142 | content: "\f155";
1143 | }
1144 | .fa-rupee:before,
1145 | .fa-inr:before {
1146 | content: "\f156";
1147 | }
1148 | .fa-cny:before,
1149 | .fa-rmb:before,
1150 | .fa-yen:before,
1151 | .fa-jpy:before {
1152 | content: "\f157";
1153 | }
1154 | .fa-ruble:before,
1155 | .fa-rouble:before,
1156 | .fa-rub:before {
1157 | content: "\f158";
1158 | }
1159 | .fa-won:before,
1160 | .fa-krw:before {
1161 | content: "\f159";
1162 | }
1163 | .fa-bitcoin:before,
1164 | .fa-btc:before {
1165 | content: "\f15a";
1166 | }
1167 | .fa-file:before {
1168 | content: "\f15b";
1169 | }
1170 | .fa-file-text:before {
1171 | content: "\f15c";
1172 | }
1173 | .fa-sort-alpha-asc:before {
1174 | content: "\f15d";
1175 | }
1176 | .fa-sort-alpha-desc:before {
1177 | content: "\f15e";
1178 | }
1179 | .fa-sort-amount-asc:before {
1180 | content: "\f160";
1181 | }
1182 | .fa-sort-amount-desc:before {
1183 | content: "\f161";
1184 | }
1185 | .fa-sort-numeric-asc:before {
1186 | content: "\f162";
1187 | }
1188 | .fa-sort-numeric-desc:before {
1189 | content: "\f163";
1190 | }
1191 | .fa-thumbs-up:before {
1192 | content: "\f164";
1193 | }
1194 | .fa-thumbs-down:before {
1195 | content: "\f165";
1196 | }
1197 | .fa-youtube-square:before {
1198 | content: "\f166";
1199 | }
1200 | .fa-youtube:before {
1201 | content: "\f167";
1202 | }
1203 | .fa-xing:before {
1204 | content: "\f168";
1205 | }
1206 | .fa-xing-square:before {
1207 | content: "\f169";
1208 | }
1209 | .fa-youtube-play:before {
1210 | content: "\f16a";
1211 | }
1212 | .fa-dropbox:before {
1213 | content: "\f16b";
1214 | }
1215 | .fa-stack-overflow:before {
1216 | content: "\f16c";
1217 | }
1218 | .fa-instagram:before {
1219 | content: "\f16d";
1220 | }
1221 | .fa-flickr:before {
1222 | content: "\f16e";
1223 | }
1224 | .fa-adn:before {
1225 | content: "\f170";
1226 | }
1227 | .fa-bitbucket:before {
1228 | content: "\f171";
1229 | }
1230 | .fa-bitbucket-square:before {
1231 | content: "\f172";
1232 | }
1233 | .fa-tumblr:before {
1234 | content: "\f173";
1235 | }
1236 | .fa-tumblr-square:before {
1237 | content: "\f174";
1238 | }
1239 | .fa-long-arrow-down:before {
1240 | content: "\f175";
1241 | }
1242 | .fa-long-arrow-up:before {
1243 | content: "\f176";
1244 | }
1245 | .fa-long-arrow-left:before {
1246 | content: "\f177";
1247 | }
1248 | .fa-long-arrow-right:before {
1249 | content: "\f178";
1250 | }
1251 | .fa-apple:before {
1252 | content: "\f179";
1253 | }
1254 | .fa-windows:before {
1255 | content: "\f17a";
1256 | }
1257 | .fa-android:before {
1258 | content: "\f17b";
1259 | }
1260 | .fa-linux:before {
1261 | content: "\f17c";
1262 | }
1263 | .fa-dribbble:before {
1264 | content: "\f17d";
1265 | }
1266 | .fa-skype:before {
1267 | content: "\f17e";
1268 | }
1269 | .fa-foursquare:before {
1270 | content: "\f180";
1271 | }
1272 | .fa-trello:before {
1273 | content: "\f181";
1274 | }
1275 | .fa-female:before {
1276 | content: "\f182";
1277 | }
1278 | .fa-male:before {
1279 | content: "\f183";
1280 | }
1281 | .fa-gittip:before,
1282 | .fa-gratipay:before {
1283 | content: "\f184";
1284 | }
1285 | .fa-sun-o:before {
1286 | content: "\f185";
1287 | }
1288 | .fa-moon-o:before {
1289 | content: "\f186";
1290 | }
1291 | .fa-archive:before {
1292 | content: "\f187";
1293 | }
1294 | .fa-bug:before {
1295 | content: "\f188";
1296 | }
1297 | .fa-vk:before {
1298 | content: "\f189";
1299 | }
1300 | .fa-weibo:before {
1301 | content: "\f18a";
1302 | }
1303 | .fa-renren:before {
1304 | content: "\f18b";
1305 | }
1306 | .fa-pagelines:before {
1307 | content: "\f18c";
1308 | }
1309 | .fa-stack-exchange:before {
1310 | content: "\f18d";
1311 | }
1312 | .fa-arrow-circle-o-right:before {
1313 | content: "\f18e";
1314 | }
1315 | .fa-arrow-circle-o-left:before {
1316 | content: "\f190";
1317 | }
1318 | .fa-toggle-left:before,
1319 | .fa-caret-square-o-left:before {
1320 | content: "\f191";
1321 | }
1322 | .fa-dot-circle-o:before {
1323 | content: "\f192";
1324 | }
1325 | .fa-wheelchair:before {
1326 | content: "\f193";
1327 | }
1328 | .fa-vimeo-square:before {
1329 | content: "\f194";
1330 | }
1331 | .fa-turkish-lira:before,
1332 | .fa-try:before {
1333 | content: "\f195";
1334 | }
1335 | .fa-plus-square-o:before {
1336 | content: "\f196";
1337 | }
1338 | .fa-space-shuttle:before {
1339 | content: "\f197";
1340 | }
1341 | .fa-slack:before {
1342 | content: "\f198";
1343 | }
1344 | .fa-envelope-square:before {
1345 | content: "\f199";
1346 | }
1347 | .fa-wordpress:before {
1348 | content: "\f19a";
1349 | }
1350 | .fa-openid:before {
1351 | content: "\f19b";
1352 | }
1353 | .fa-institution:before,
1354 | .fa-bank:before,
1355 | .fa-university:before {
1356 | content: "\f19c";
1357 | }
1358 | .fa-mortar-board:before,
1359 | .fa-graduation-cap:before {
1360 | content: "\f19d";
1361 | }
1362 | .fa-yahoo:before {
1363 | content: "\f19e";
1364 | }
1365 | .fa-google:before {
1366 | content: "\f1a0";
1367 | }
1368 | .fa-reddit:before {
1369 | content: "\f1a1";
1370 | }
1371 | .fa-reddit-square:before {
1372 | content: "\f1a2";
1373 | }
1374 | .fa-stumbleupon-circle:before {
1375 | content: "\f1a3";
1376 | }
1377 | .fa-stumbleupon:before {
1378 | content: "\f1a4";
1379 | }
1380 | .fa-delicious:before {
1381 | content: "\f1a5";
1382 | }
1383 | .fa-digg:before {
1384 | content: "\f1a6";
1385 | }
1386 | .fa-pied-piper-pp:before {
1387 | content: "\f1a7";
1388 | }
1389 | .fa-pied-piper-alt:before {
1390 | content: "\f1a8";
1391 | }
1392 | .fa-drupal:before {
1393 | content: "\f1a9";
1394 | }
1395 | .fa-joomla:before {
1396 | content: "\f1aa";
1397 | }
1398 | .fa-language:before {
1399 | content: "\f1ab";
1400 | }
1401 | .fa-fax:before {
1402 | content: "\f1ac";
1403 | }
1404 | .fa-building:before {
1405 | content: "\f1ad";
1406 | }
1407 | .fa-child:before {
1408 | content: "\f1ae";
1409 | }
1410 | .fa-paw:before {
1411 | content: "\f1b0";
1412 | }
1413 | .fa-spoon:before {
1414 | content: "\f1b1";
1415 | }
1416 | .fa-cube:before {
1417 | content: "\f1b2";
1418 | }
1419 | .fa-cubes:before {
1420 | content: "\f1b3";
1421 | }
1422 | .fa-behance:before {
1423 | content: "\f1b4";
1424 | }
1425 | .fa-behance-square:before {
1426 | content: "\f1b5";
1427 | }
1428 | .fa-steam:before {
1429 | content: "\f1b6";
1430 | }
1431 | .fa-steam-square:before {
1432 | content: "\f1b7";
1433 | }
1434 | .fa-recycle:before {
1435 | content: "\f1b8";
1436 | }
1437 | .fa-automobile:before,
1438 | .fa-car:before {
1439 | content: "\f1b9";
1440 | }
1441 | .fa-cab:before,
1442 | .fa-taxi:before {
1443 | content: "\f1ba";
1444 | }
1445 | .fa-tree:before {
1446 | content: "\f1bb";
1447 | }
1448 | .fa-spotify:before {
1449 | content: "\f1bc";
1450 | }
1451 | .fa-deviantart:before {
1452 | content: "\f1bd";
1453 | }
1454 | .fa-soundcloud:before {
1455 | content: "\f1be";
1456 | }
1457 | .fa-database:before {
1458 | content: "\f1c0";
1459 | }
1460 | .fa-file-pdf-o:before {
1461 | content: "\f1c1";
1462 | }
1463 | .fa-file-word-o:before {
1464 | content: "\f1c2";
1465 | }
1466 | .fa-file-excel-o:before {
1467 | content: "\f1c3";
1468 | }
1469 | .fa-file-powerpoint-o:before {
1470 | content: "\f1c4";
1471 | }
1472 | .fa-file-photo-o:before,
1473 | .fa-file-picture-o:before,
1474 | .fa-file-image-o:before {
1475 | content: "\f1c5";
1476 | }
1477 | .fa-file-zip-o:before,
1478 | .fa-file-archive-o:before {
1479 | content: "\f1c6";
1480 | }
1481 | .fa-file-sound-o:before,
1482 | .fa-file-audio-o:before {
1483 | content: "\f1c7";
1484 | }
1485 | .fa-file-movie-o:before,
1486 | .fa-file-video-o:before {
1487 | content: "\f1c8";
1488 | }
1489 | .fa-file-code-o:before {
1490 | content: "\f1c9";
1491 | }
1492 | .fa-vine:before {
1493 | content: "\f1ca";
1494 | }
1495 | .fa-codepen:before {
1496 | content: "\f1cb";
1497 | }
1498 | .fa-jsfiddle:before {
1499 | content: "\f1cc";
1500 | }
1501 | .fa-life-bouy:before,
1502 | .fa-life-buoy:before,
1503 | .fa-life-saver:before,
1504 | .fa-support:before,
1505 | .fa-life-ring:before {
1506 | content: "\f1cd";
1507 | }
1508 | .fa-circle-o-notch:before {
1509 | content: "\f1ce";
1510 | }
1511 | .fa-ra:before,
1512 | .fa-resistance:before,
1513 | .fa-rebel:before {
1514 | content: "\f1d0";
1515 | }
1516 | .fa-ge:before,
1517 | .fa-empire:before {
1518 | content: "\f1d1";
1519 | }
1520 | .fa-git-square:before {
1521 | content: "\f1d2";
1522 | }
1523 | .fa-git:before {
1524 | content: "\f1d3";
1525 | }
1526 | .fa-y-combinator-square:before,
1527 | .fa-yc-square:before,
1528 | .fa-hacker-news:before {
1529 | content: "\f1d4";
1530 | }
1531 | .fa-tencent-weibo:before {
1532 | content: "\f1d5";
1533 | }
1534 | .fa-qq:before {
1535 | content: "\f1d6";
1536 | }
1537 | .fa-wechat:before,
1538 | .fa-weixin:before {
1539 | content: "\f1d7";
1540 | }
1541 | .fa-send:before,
1542 | .fa-paper-plane:before {
1543 | content: "\f1d8";
1544 | }
1545 | .fa-send-o:before,
1546 | .fa-paper-plane-o:before {
1547 | content: "\f1d9";
1548 | }
1549 | .fa-history:before {
1550 | content: "\f1da";
1551 | }
1552 | .fa-circle-thin:before {
1553 | content: "\f1db";
1554 | }
1555 | .fa-header:before {
1556 | content: "\f1dc";
1557 | }
1558 | .fa-paragraph:before {
1559 | content: "\f1dd";
1560 | }
1561 | .fa-sliders:before {
1562 | content: "\f1de";
1563 | }
1564 | .fa-share-alt:before {
1565 | content: "\f1e0";
1566 | }
1567 | .fa-share-alt-square:before {
1568 | content: "\f1e1";
1569 | }
1570 | .fa-bomb:before {
1571 | content: "\f1e2";
1572 | }
1573 | .fa-soccer-ball-o:before,
1574 | .fa-futbol-o:before {
1575 | content: "\f1e3";
1576 | }
1577 | .fa-tty:before {
1578 | content: "\f1e4";
1579 | }
1580 | .fa-binoculars:before {
1581 | content: "\f1e5";
1582 | }
1583 | .fa-plug:before {
1584 | content: "\f1e6";
1585 | }
1586 | .fa-slideshare:before {
1587 | content: "\f1e7";
1588 | }
1589 | .fa-twitch:before {
1590 | content: "\f1e8";
1591 | }
1592 | .fa-yelp:before {
1593 | content: "\f1e9";
1594 | }
1595 | .fa-newspaper-o:before {
1596 | content: "\f1ea";
1597 | }
1598 | .fa-wifi:before {
1599 | content: "\f1eb";
1600 | }
1601 | .fa-calculator:before {
1602 | content: "\f1ec";
1603 | }
1604 | .fa-paypal:before {
1605 | content: "\f1ed";
1606 | }
1607 | .fa-google-wallet:before {
1608 | content: "\f1ee";
1609 | }
1610 | .fa-cc-visa:before {
1611 | content: "\f1f0";
1612 | }
1613 | .fa-cc-mastercard:before {
1614 | content: "\f1f1";
1615 | }
1616 | .fa-cc-discover:before {
1617 | content: "\f1f2";
1618 | }
1619 | .fa-cc-amex:before {
1620 | content: "\f1f3";
1621 | }
1622 | .fa-cc-paypal:before {
1623 | content: "\f1f4";
1624 | }
1625 | .fa-cc-stripe:before {
1626 | content: "\f1f5";
1627 | }
1628 | .fa-bell-slash:before {
1629 | content: "\f1f6";
1630 | }
1631 | .fa-bell-slash-o:before {
1632 | content: "\f1f7";
1633 | }
1634 | .fa-trash:before {
1635 | content: "\f1f8";
1636 | }
1637 | .fa-copyright:before {
1638 | content: "\f1f9";
1639 | }
1640 | .fa-at:before {
1641 | content: "\f1fa";
1642 | }
1643 | .fa-eyedropper:before {
1644 | content: "\f1fb";
1645 | }
1646 | .fa-paint-brush:before {
1647 | content: "\f1fc";
1648 | }
1649 | .fa-birthday-cake:before {
1650 | content: "\f1fd";
1651 | }
1652 | .fa-area-chart:before {
1653 | content: "\f1fe";
1654 | }
1655 | .fa-pie-chart:before {
1656 | content: "\f200";
1657 | }
1658 | .fa-line-chart:before {
1659 | content: "\f201";
1660 | }
1661 | .fa-lastfm:before {
1662 | content: "\f202";
1663 | }
1664 | .fa-lastfm-square:before {
1665 | content: "\f203";
1666 | }
1667 | .fa-toggle-off:before {
1668 | content: "\f204";
1669 | }
1670 | .fa-toggle-on:before {
1671 | content: "\f205";
1672 | }
1673 | .fa-bicycle:before {
1674 | content: "\f206";
1675 | }
1676 | .fa-bus:before {
1677 | content: "\f207";
1678 | }
1679 | .fa-ioxhost:before {
1680 | content: "\f208";
1681 | }
1682 | .fa-angellist:before {
1683 | content: "\f209";
1684 | }
1685 | .fa-cc:before {
1686 | content: "\f20a";
1687 | }
1688 | .fa-shekel:before,
1689 | .fa-sheqel:before,
1690 | .fa-ils:before {
1691 | content: "\f20b";
1692 | }
1693 | .fa-meanpath:before {
1694 | content: "\f20c";
1695 | }
1696 | .fa-buysellads:before {
1697 | content: "\f20d";
1698 | }
1699 | .fa-connectdevelop:before {
1700 | content: "\f20e";
1701 | }
1702 | .fa-dashcube:before {
1703 | content: "\f210";
1704 | }
1705 | .fa-forumbee:before {
1706 | content: "\f211";
1707 | }
1708 | .fa-leanpub:before {
1709 | content: "\f212";
1710 | }
1711 | .fa-sellsy:before {
1712 | content: "\f213";
1713 | }
1714 | .fa-shirtsinbulk:before {
1715 | content: "\f214";
1716 | }
1717 | .fa-simplybuilt:before {
1718 | content: "\f215";
1719 | }
1720 | .fa-skyatlas:before {
1721 | content: "\f216";
1722 | }
1723 | .fa-cart-plus:before {
1724 | content: "\f217";
1725 | }
1726 | .fa-cart-arrow-down:before {
1727 | content: "\f218";
1728 | }
1729 | .fa-diamond:before {
1730 | content: "\f219";
1731 | }
1732 | .fa-ship:before {
1733 | content: "\f21a";
1734 | }
1735 | .fa-user-secret:before {
1736 | content: "\f21b";
1737 | }
1738 | .fa-motorcycle:before {
1739 | content: "\f21c";
1740 | }
1741 | .fa-street-view:before {
1742 | content: "\f21d";
1743 | }
1744 | .fa-heartbeat:before {
1745 | content: "\f21e";
1746 | }
1747 | .fa-venus:before {
1748 | content: "\f221";
1749 | }
1750 | .fa-mars:before {
1751 | content: "\f222";
1752 | }
1753 | .fa-mercury:before {
1754 | content: "\f223";
1755 | }
1756 | .fa-intersex:before,
1757 | .fa-transgender:before {
1758 | content: "\f224";
1759 | }
1760 | .fa-transgender-alt:before {
1761 | content: "\f225";
1762 | }
1763 | .fa-venus-double:before {
1764 | content: "\f226";
1765 | }
1766 | .fa-mars-double:before {
1767 | content: "\f227";
1768 | }
1769 | .fa-venus-mars:before {
1770 | content: "\f228";
1771 | }
1772 | .fa-mars-stroke:before {
1773 | content: "\f229";
1774 | }
1775 | .fa-mars-stroke-v:before {
1776 | content: "\f22a";
1777 | }
1778 | .fa-mars-stroke-h:before {
1779 | content: "\f22b";
1780 | }
1781 | .fa-neuter:before {
1782 | content: "\f22c";
1783 | }
1784 | .fa-genderless:before {
1785 | content: "\f22d";
1786 | }
1787 | .fa-facebook-official:before {
1788 | content: "\f230";
1789 | }
1790 | .fa-pinterest-p:before {
1791 | content: "\f231";
1792 | }
1793 | .fa-whatsapp:before {
1794 | content: "\f232";
1795 | }
1796 | .fa-server:before {
1797 | content: "\f233";
1798 | }
1799 | .fa-user-plus:before {
1800 | content: "\f234";
1801 | }
1802 | .fa-user-times:before {
1803 | content: "\f235";
1804 | }
1805 | .fa-hotel:before,
1806 | .fa-bed:before {
1807 | content: "\f236";
1808 | }
1809 | .fa-viacoin:before {
1810 | content: "\f237";
1811 | }
1812 | .fa-train:before {
1813 | content: "\f238";
1814 | }
1815 | .fa-subway:before {
1816 | content: "\f239";
1817 | }
1818 | .fa-medium:before {
1819 | content: "\f23a";
1820 | }
1821 | .fa-yc:before,
1822 | .fa-y-combinator:before {
1823 | content: "\f23b";
1824 | }
1825 | .fa-optin-monster:before {
1826 | content: "\f23c";
1827 | }
1828 | .fa-opencart:before {
1829 | content: "\f23d";
1830 | }
1831 | .fa-expeditedssl:before {
1832 | content: "\f23e";
1833 | }
1834 | .fa-battery-4:before,
1835 | .fa-battery:before,
1836 | .fa-battery-full:before {
1837 | content: "\f240";
1838 | }
1839 | .fa-battery-3:before,
1840 | .fa-battery-three-quarters:before {
1841 | content: "\f241";
1842 | }
1843 | .fa-battery-2:before,
1844 | .fa-battery-half:before {
1845 | content: "\f242";
1846 | }
1847 | .fa-battery-1:before,
1848 | .fa-battery-quarter:before {
1849 | content: "\f243";
1850 | }
1851 | .fa-battery-0:before,
1852 | .fa-battery-empty:before {
1853 | content: "\f244";
1854 | }
1855 | .fa-mouse-pointer:before {
1856 | content: "\f245";
1857 | }
1858 | .fa-i-cursor:before {
1859 | content: "\f246";
1860 | }
1861 | .fa-object-group:before {
1862 | content: "\f247";
1863 | }
1864 | .fa-object-ungroup:before {
1865 | content: "\f248";
1866 | }
1867 | .fa-sticky-note:before {
1868 | content: "\f249";
1869 | }
1870 | .fa-sticky-note-o:before {
1871 | content: "\f24a";
1872 | }
1873 | .fa-cc-jcb:before {
1874 | content: "\f24b";
1875 | }
1876 | .fa-cc-diners-club:before {
1877 | content: "\f24c";
1878 | }
1879 | .fa-clone:before {
1880 | content: "\f24d";
1881 | }
1882 | .fa-balance-scale:before {
1883 | content: "\f24e";
1884 | }
1885 | .fa-hourglass-o:before {
1886 | content: "\f250";
1887 | }
1888 | .fa-hourglass-1:before,
1889 | .fa-hourglass-start:before {
1890 | content: "\f251";
1891 | }
1892 | .fa-hourglass-2:before,
1893 | .fa-hourglass-half:before {
1894 | content: "\f252";
1895 | }
1896 | .fa-hourglass-3:before,
1897 | .fa-hourglass-end:before {
1898 | content: "\f253";
1899 | }
1900 | .fa-hourglass:before {
1901 | content: "\f254";
1902 | }
1903 | .fa-hand-grab-o:before,
1904 | .fa-hand-rock-o:before {
1905 | content: "\f255";
1906 | }
1907 | .fa-hand-stop-o:before,
1908 | .fa-hand-paper-o:before {
1909 | content: "\f256";
1910 | }
1911 | .fa-hand-scissors-o:before {
1912 | content: "\f257";
1913 | }
1914 | .fa-hand-lizard-o:before {
1915 | content: "\f258";
1916 | }
1917 | .fa-hand-spock-o:before {
1918 | content: "\f259";
1919 | }
1920 | .fa-hand-pointer-o:before {
1921 | content: "\f25a";
1922 | }
1923 | .fa-hand-peace-o:before {
1924 | content: "\f25b";
1925 | }
1926 | .fa-trademark:before {
1927 | content: "\f25c";
1928 | }
1929 | .fa-registered:before {
1930 | content: "\f25d";
1931 | }
1932 | .fa-creative-commons:before {
1933 | content: "\f25e";
1934 | }
1935 | .fa-gg:before {
1936 | content: "\f260";
1937 | }
1938 | .fa-gg-circle:before {
1939 | content: "\f261";
1940 | }
1941 | .fa-tripadvisor:before {
1942 | content: "\f262";
1943 | }
1944 | .fa-odnoklassniki:before {
1945 | content: "\f263";
1946 | }
1947 | .fa-odnoklassniki-square:before {
1948 | content: "\f264";
1949 | }
1950 | .fa-get-pocket:before {
1951 | content: "\f265";
1952 | }
1953 | .fa-wikipedia-w:before {
1954 | content: "\f266";
1955 | }
1956 | .fa-safari:before {
1957 | content: "\f267";
1958 | }
1959 | .fa-chrome:before {
1960 | content: "\f268";
1961 | }
1962 | .fa-firefox:before {
1963 | content: "\f269";
1964 | }
1965 | .fa-opera:before {
1966 | content: "\f26a";
1967 | }
1968 | .fa-internet-explorer:before {
1969 | content: "\f26b";
1970 | }
1971 | .fa-tv:before,
1972 | .fa-television:before {
1973 | content: "\f26c";
1974 | }
1975 | .fa-contao:before {
1976 | content: "\f26d";
1977 | }
1978 | .fa-500px:before {
1979 | content: "\f26e";
1980 | }
1981 | .fa-amazon:before {
1982 | content: "\f270";
1983 | }
1984 | .fa-calendar-plus-o:before {
1985 | content: "\f271";
1986 | }
1987 | .fa-calendar-minus-o:before {
1988 | content: "\f272";
1989 | }
1990 | .fa-calendar-times-o:before {
1991 | content: "\f273";
1992 | }
1993 | .fa-calendar-check-o:before {
1994 | content: "\f274";
1995 | }
1996 | .fa-industry:before {
1997 | content: "\f275";
1998 | }
1999 | .fa-map-pin:before {
2000 | content: "\f276";
2001 | }
2002 | .fa-map-signs:before {
2003 | content: "\f277";
2004 | }
2005 | .fa-map-o:before {
2006 | content: "\f278";
2007 | }
2008 | .fa-map:before {
2009 | content: "\f279";
2010 | }
2011 | .fa-commenting:before {
2012 | content: "\f27a";
2013 | }
2014 | .fa-commenting-o:before {
2015 | content: "\f27b";
2016 | }
2017 | .fa-houzz:before {
2018 | content: "\f27c";
2019 | }
2020 | .fa-vimeo:before {
2021 | content: "\f27d";
2022 | }
2023 | .fa-black-tie:before {
2024 | content: "\f27e";
2025 | }
2026 | .fa-fonticons:before {
2027 | content: "\f280";
2028 | }
2029 | .fa-reddit-alien:before {
2030 | content: "\f281";
2031 | }
2032 | .fa-edge:before {
2033 | content: "\f282";
2034 | }
2035 | .fa-credit-card-alt:before {
2036 | content: "\f283";
2037 | }
2038 | .fa-codiepie:before {
2039 | content: "\f284";
2040 | }
2041 | .fa-modx:before {
2042 | content: "\f285";
2043 | }
2044 | .fa-fort-awesome:before {
2045 | content: "\f286";
2046 | }
2047 | .fa-usb:before {
2048 | content: "\f287";
2049 | }
2050 | .fa-product-hunt:before {
2051 | content: "\f288";
2052 | }
2053 | .fa-mixcloud:before {
2054 | content: "\f289";
2055 | }
2056 | .fa-scribd:before {
2057 | content: "\f28a";
2058 | }
2059 | .fa-pause-circle:before {
2060 | content: "\f28b";
2061 | }
2062 | .fa-pause-circle-o:before {
2063 | content: "\f28c";
2064 | }
2065 | .fa-stop-circle:before {
2066 | content: "\f28d";
2067 | }
2068 | .fa-stop-circle-o:before {
2069 | content: "\f28e";
2070 | }
2071 | .fa-shopping-bag:before {
2072 | content: "\f290";
2073 | }
2074 | .fa-shopping-basket:before {
2075 | content: "\f291";
2076 | }
2077 | .fa-hashtag:before {
2078 | content: "\f292";
2079 | }
2080 | .fa-bluetooth:before {
2081 | content: "\f293";
2082 | }
2083 | .fa-bluetooth-b:before {
2084 | content: "\f294";
2085 | }
2086 | .fa-percent:before {
2087 | content: "\f295";
2088 | }
2089 | .fa-gitlab:before {
2090 | content: "\f296";
2091 | }
2092 | .fa-wpbeginner:before {
2093 | content: "\f297";
2094 | }
2095 | .fa-wpforms:before {
2096 | content: "\f298";
2097 | }
2098 | .fa-envira:before {
2099 | content: "\f299";
2100 | }
2101 | .fa-universal-access:before {
2102 | content: "\f29a";
2103 | }
2104 | .fa-wheelchair-alt:before {
2105 | content: "\f29b";
2106 | }
2107 | .fa-question-circle-o:before {
2108 | content: "\f29c";
2109 | }
2110 | .fa-blind:before {
2111 | content: "\f29d";
2112 | }
2113 | .fa-audio-description:before {
2114 | content: "\f29e";
2115 | }
2116 | .fa-volume-control-phone:before {
2117 | content: "\f2a0";
2118 | }
2119 | .fa-braille:before {
2120 | content: "\f2a1";
2121 | }
2122 | .fa-assistive-listening-systems:before {
2123 | content: "\f2a2";
2124 | }
2125 | .fa-asl-interpreting:before,
2126 | .fa-american-sign-language-interpreting:before {
2127 | content: "\f2a3";
2128 | }
2129 | .fa-deafness:before,
2130 | .fa-hard-of-hearing:before,
2131 | .fa-deaf:before {
2132 | content: "\f2a4";
2133 | }
2134 | .fa-glide:before {
2135 | content: "\f2a5";
2136 | }
2137 | .fa-glide-g:before {
2138 | content: "\f2a6";
2139 | }
2140 | .fa-signing:before,
2141 | .fa-sign-language:before {
2142 | content: "\f2a7";
2143 | }
2144 | .fa-low-vision:before {
2145 | content: "\f2a8";
2146 | }
2147 | .fa-viadeo:before {
2148 | content: "\f2a9";
2149 | }
2150 | .fa-viadeo-square:before {
2151 | content: "\f2aa";
2152 | }
2153 | .fa-snapchat:before {
2154 | content: "\f2ab";
2155 | }
2156 | .fa-snapchat-ghost:before {
2157 | content: "\f2ac";
2158 | }
2159 | .fa-snapchat-square:before {
2160 | content: "\f2ad";
2161 | }
2162 | .fa-pied-piper:before {
2163 | content: "\f2ae";
2164 | }
2165 | .fa-first-order:before {
2166 | content: "\f2b0";
2167 | }
2168 | .fa-yoast:before {
2169 | content: "\f2b1";
2170 | }
2171 | .fa-themeisle:before {
2172 | content: "\f2b2";
2173 | }
2174 | .fa-google-plus-circle:before,
2175 | .fa-google-plus-official:before {
2176 | content: "\f2b3";
2177 | }
2178 | .fa-fa:before,
2179 | .fa-font-awesome:before {
2180 | content: "\f2b4";
2181 | }
2182 | .fa-handshake-o:before {
2183 | content: "\f2b5";
2184 | }
2185 | .fa-envelope-open:before {
2186 | content: "\f2b6";
2187 | }
2188 | .fa-envelope-open-o:before {
2189 | content: "\f2b7";
2190 | }
2191 | .fa-linode:before {
2192 | content: "\f2b8";
2193 | }
2194 | .fa-address-book:before {
2195 | content: "\f2b9";
2196 | }
2197 | .fa-address-book-o:before {
2198 | content: "\f2ba";
2199 | }
2200 | .fa-vcard:before,
2201 | .fa-address-card:before {
2202 | content: "\f2bb";
2203 | }
2204 | .fa-vcard-o:before,
2205 | .fa-address-card-o:before {
2206 | content: "\f2bc";
2207 | }
2208 | .fa-user-circle:before {
2209 | content: "\f2bd";
2210 | }
2211 | .fa-user-circle-o:before {
2212 | content: "\f2be";
2213 | }
2214 | .fa-user-o:before {
2215 | content: "\f2c0";
2216 | }
2217 | .fa-id-badge:before {
2218 | content: "\f2c1";
2219 | }
2220 | .fa-drivers-license:before,
2221 | .fa-id-card:before {
2222 | content: "\f2c2";
2223 | }
2224 | .fa-drivers-license-o:before,
2225 | .fa-id-card-o:before {
2226 | content: "\f2c3";
2227 | }
2228 | .fa-quora:before {
2229 | content: "\f2c4";
2230 | }
2231 | .fa-free-code-camp:before {
2232 | content: "\f2c5";
2233 | }
2234 | .fa-telegram:before {
2235 | content: "\f2c6";
2236 | }
2237 | .fa-thermometer-4:before,
2238 | .fa-thermometer:before,
2239 | .fa-thermometer-full:before {
2240 | content: "\f2c7";
2241 | }
2242 | .fa-thermometer-3:before,
2243 | .fa-thermometer-three-quarters:before {
2244 | content: "\f2c8";
2245 | }
2246 | .fa-thermometer-2:before,
2247 | .fa-thermometer-half:before {
2248 | content: "\f2c9";
2249 | }
2250 | .fa-thermometer-1:before,
2251 | .fa-thermometer-quarter:before {
2252 | content: "\f2ca";
2253 | }
2254 | .fa-thermometer-0:before,
2255 | .fa-thermometer-empty:before {
2256 | content: "\f2cb";
2257 | }
2258 | .fa-shower:before {
2259 | content: "\f2cc";
2260 | }
2261 | .fa-bathtub:before,
2262 | .fa-s15:before,
2263 | .fa-bath:before {
2264 | content: "\f2cd";
2265 | }
2266 | .fa-podcast:before {
2267 | content: "\f2ce";
2268 | }
2269 | .fa-window-maximize:before {
2270 | content: "\f2d0";
2271 | }
2272 | .fa-window-minimize:before {
2273 | content: "\f2d1";
2274 | }
2275 | .fa-window-restore:before {
2276 | content: "\f2d2";
2277 | }
2278 | .fa-times-rectangle:before,
2279 | .fa-window-close:before {
2280 | content: "\f2d3";
2281 | }
2282 | .fa-times-rectangle-o:before,
2283 | .fa-window-close-o:before {
2284 | content: "\f2d4";
2285 | }
2286 | .fa-bandcamp:before {
2287 | content: "\f2d5";
2288 | }
2289 | .fa-grav:before {
2290 | content: "\f2d6";
2291 | }
2292 | .fa-etsy:before {
2293 | content: "\f2d7";
2294 | }
2295 | .fa-imdb:before {
2296 | content: "\f2d8";
2297 | }
2298 | .fa-ravelry:before {
2299 | content: "\f2d9";
2300 | }
2301 | .fa-eercast:before {
2302 | content: "\f2da";
2303 | }
2304 | .fa-microchip:before {
2305 | content: "\f2db";
2306 | }
2307 | .fa-snowflake-o:before {
2308 | content: "\f2dc";
2309 | }
2310 | .fa-superpowers:before {
2311 | content: "\f2dd";
2312 | }
2313 | .fa-wpexplorer:before {
2314 | content: "\f2de";
2315 | }
2316 | .fa-meetup:before {
2317 | content: "\f2e0";
2318 | }
2319 | .sr-only {
2320 | position: absolute;
2321 | width: 1px;
2322 | height: 1px;
2323 | padding: 0;
2324 | margin: -1px;
2325 | overflow: hidden;
2326 | clip: rect(0, 0, 0, 0);
2327 | border: 0;
2328 | }
2329 | .sr-only-focusable:active,
2330 | .sr-only-focusable:focus {
2331 | position: static;
2332 | width: auto;
2333 | height: auto;
2334 | margin: 0;
2335 | overflow: visible;
2336 | clip: auto;
2337 | }
2338 |
--------------------------------------------------------------------------------
/tests/_support/assets/css/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/tests/_support/assets/js/main.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | alert('Hello there');
3 | });
--------------------------------------------------------------------------------
/tests/_support/public/css/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michalsn/minifier/e85218707ff5833c6e8b8efb162b7af45d207d35/tests/_support/public/css/.gitkeep
--------------------------------------------------------------------------------
/tests/_support/public/js/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michalsn/minifier/e85218707ff5833c6e8b8efb162b7af45d207d35/tests/_support/public/js/.gitkeep
--------------------------------------------------------------------------------