1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-30 09:09:54 +02:00

Collapse "min" into project root and get unit tests working.

Fixes #472
This commit is contained in:
Steve Clay
2015-09-28 15:36:52 -04:00
parent 2720239c8c
commit e596b35fc4
89 changed files with 133 additions and 94 deletions

View File

@@ -24,15 +24,29 @@ Unfortunately we can't support the WordPress plugins here.
Installation
------------
Place the `/min/` directory as a child of your DOCUMENT_ROOT
directory: i.e. you will have: `/home/example/www/min`
Installation requires PHP 5.3+, SSH access, and access to tools like `git` and `composer` or the privileges to install them.
You can see verify that it is working by visiting these two URLs:
- http://example.org/min/?f=min/quick-test.js
- http://example.org/min/?f=min/quick-test.css
```bash
cd /path/to/public_html
git clone https://github.com/mrclay/minify.git min
cd min
composer install
```
What this does:
1. Inside your DOCUMENT_ROOT directory, we clone this repo. Otherwise you may [download](https://github.com/mrclay/minify/archive/master.zip) and extract the zip file.
1. We rename this directory `min`. E.g. You will have something like: `/home/example/public_html/min`
1. We `cd` into it and run `composer install` to install the dependencies.
You can verify that it is working by visiting these two URLs:
* http://example.org/min/?f=min/quick-test.js
* http://example.org/min/?f=min/quick-test.css
If your server supports mod_rewrite, this URL should also work:
- http://example.org/min/f=min/quick-test.js
* http://example.org/min/f=min/quick-test.js
Configuration & Usage
---------------------
@@ -54,22 +68,17 @@ Support
Unit Testing
------------
1. Place the /min_unit_tests/ directory as a child of your DOCUMENT_ROOT
directory: i.e. you will have: /home/example/www/min_unit_tests
2. To run unit tests, access: http://example.org/min_unit_tests/test_all.php
(If you wish, the other test_*.php files can be run to test individual
components with more verbose output.)
3. Remove /min_unit_tests/ from your DOCUMENT_ROOT when you are done.
1. Open the file `min_unit_tests/_inc.php`.
1. Enable the file by commenting out the `die()` statement.
1. Access: http://example.org/min/min_unit_tests/test_all.php (If you wish, the other test_*.php files can be run to test individual components with more verbose output.)
1. Re-disable the `_inc.php` file when you are done.
Warnings
--------
* Minify is designed for efficiency, but, for very high traffic sites, it will probably serve files slower than your HTTPd due to the CGI overhead of PHP. See the [FAQ](https://github.com/mrclay/minify/blob/master/docs/FAQ.wiki.md#how-fast-is-it) and [CookBook](https://github.com/mrclay/minify/blob/master/docs/CookBook.wiki.md) for more info.
* If you combine a lot of CSS, watch out for [IE's 4096 selectors-per-file limit](http://stackoverflow.com/a/9906889/3779), affects IE 6 through 9.
* Minify *should* work fine with files encoded in UTF-8 or other 8-bit encodings like ISO 8859/Windows-1252. By default Minify appends ";charset=utf-8" to the Content-Type headers it sends.
* Minify is designed for efficiency, but, for very high traffic sites, it will probably serve files slower than your HTTPd due to the CGI overhead of PHP. See the [FAQ](https://github.com/mrclay/minify/blob/master/docs/FAQ.wiki.md#how-fast-is-it) and [CookBook](https://github.com/mrclay/minify/blob/master/docs/CookBook.wiki.md) for more info.
* If you combine a lot of CSS, watch out for [IE's 4096 selectors-per-file limit](http://stackoverflow.com/a/9906889/3779), affects IE 6 through 9.
* Minify *should* work fine with files encoded in UTF-8 or other 8-bit encodings like ISO 8859/Windows-1252. By default Minify appends ";charset=utf-8" to the Content-Type headers it sends.
Acknowledgments
---------------