1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-31 17:42:02 +02:00

166 Commits

Author SHA1 Message Date
Elan Ruusamäe
035183b2b8 cacheIsStale is not public 2016-10-13 14:40:21 +03:00
Elan Ruusamäe
72dd4db37a calculate lastmodified to be maximum accurate
the time() may be incorrect if there's slight delay between file modify and cache write. but as file modify is what is important, rely on that.

also needed to use different cache file because the format change.
2016-10-13 12:50:27 +03:00
Elan Ruusamäe
78d5921f91 lessphp: use updated timestamp from cache
no need to calculate the timestamp ourselves each time the calculated value already present in cache object
2016-10-13 12:40:48 +03:00
Elan Ruusamäe
3014900cd4 add base directory of input file to import path
this is needed for @import to be able to resolve included files
2016-10-13 12:20:50 +03:00
Elan Ruusamäe
fdc69a369e add scss support via leafo/scssphp 2016-10-12 16:39:00 +03:00
Elan Ruusamäe
9ca1bc9e74 add checkAllowDirs to sourceFactoryOptions
needed to be able to specify the option via config
2016-10-12 16:34:39 +03:00
Steve Clay
59d4c97ffc Minify now allows static file serving
With slightly altered URLs, Minify can cache files so they're served directly
from the filesystem instead of through PHP. A simple library helps create URLs
and clearing the cache.

See `static/README.md` for details.
2016-06-29 12:43:57 -04:00
Steve Clay
a0e781e278 Merge pull request #505 from glensc/jshrink
add jshrink thin wrapper
2016-06-28 14:58:24 -04:00
Steve Clay
02c859b01b Merge pull request #532 from mrclay/urls_in_lines
Improve Minify_Lines algorithm and add tests
2016-06-28 14:52:14 -04:00
Steve Clay
31518971be Merge pull request #501 from glensc/minify-env
do not require SERVER_SOFTWARE being present in $server
2016-06-08 10:14:02 -04:00
Steve Clay
2045731d60 Improve Minify_Lines algorithm and add tests
Fixes #531
Fixes #534
2016-05-19 15:14:27 -04:00
Steve Clay
de39966e9c Makes sure all file/dir paths are normalized to prepare for comparing.
Particularly the system docRoot and currentDir values passed to the URI
rewriter and the allowDirs check.
2016-05-12 13:29:54 -04:00
Steve Clay
865946c0ed Merge branch '2.x' into merge2x
Conflicts:
	.gitignore
	HISTORY.txt
	README.md
	config.php
	docs/CookBook.wiki.md
	docs/CustomSource.wiki.md
	lib/Minify/CSS/UriRewriter.php
	min/lib/DooDigestAuth.php
	min/lib/FirePHP.php
	min/lib/JSMinPlus.php
	min/lib/Minify/Controller/Base.php
	min/lib/Minify/Loader.php
	min/lib/Minify/Logger.php
2016-05-12 11:03:16 -04:00
Steve Clay
0db2af8741 Minify::VERSION tracks only the major version 2016-05-12 10:45:58 -04:00
Steve Clay
b7cf3808d7 Improves README and add install doc page
Shows how to install as a composer dependency
2016-04-02 11:46:29 -04:00
Steve Clay
24b601217e Merge pull request #512 from mrclay/deps
Large restructuring
2016-03-10 18:48:49 -05:00
Steve Clay
4710509c68 Large restructuring
Moves all dependency building into App
bootstrap.php returns an App instance
The app loads config files as necessary
Moves logging to Monolog
Moves HTTP digest auth to packagist component
Rely on sys_get_temp_dir
Env hosts $_POST and allows defaults when reading
HTML helper uses the App and can handle less files
Source factory assumes strings are filenames
Fixes JsClosureCompilerTest::test6 (API now handles ES5 by default)
Exclude JsClosureCompilerTest due to API limitations
config.php can now return a Minify\Config object
Variables set in config.php are now moved to a `Minify\Config` object,
allowing better static analysis.
The `zlib.output_compression` set is moved into `Minify::serve`.
2016-03-10 18:44:23 -05:00
Steve Clay
7dbd2c87e4 Minify no longer tries to minify -min.js/.min.js files
2.2 used empty string as a magical value meaning do not minify, but
in the refactoring `Minify::combineMinify` forgot to interpret this
value that way and instead inherited the default compressor for the type.

This eliminates `""` as a magical value, but for BC rewrites it to
`Minify::nullMinifier` in the sources.

Fixes #499
2016-02-26 11:17:55 -05:00
Elan Ruusamäe
237d83d3cb add jshrink thin wrapper 2016-02-03 09:11:52 +02:00
Elan Ruusamäe
0b466c0892 fix debugdetector
current docs say append '&debug' to url, therefore 'debug' parameter has no value.
2016-01-22 09:05:49 +02:00
Elan Ruusamäe
9de4e927c7 truepath can be private 2016-01-22 09:04:14 +02:00
Elan Ruusamäe
72ae74f1c5 fixes to allowDirs processing, #496, #497, #498
Merge branch 'pr/496'
2016-01-22 08:50:54 +02:00
Elan Ruusamäe
14bde12d3b changes as per comments
https://github.com/mrclay/minify/pull/496#discussion_r50247608
2016-01-22 08:50:37 +02:00
Elan Ruusamäe
379feaba99 do some trivial codestyle fixes
unix newlines, trailing spaces
2016-01-22 00:38:12 +02:00
Elan Ruusamäe
90bf31f53b spelling fix 2016-01-20 18:46:41 +02:00
Elan Ruusamäe
22d34533ac do not require SERVER_SOFTWARE being present in $server 2016-01-20 16:00:39 +02:00
Elan Ruusamäe
cd49391833 cosmetic
also comment why the check may be neccessary
2016-01-20 15:41:56 +02:00
Elan Ruusamäe
7a73d781f2 closure: mute output for f5c12ad 2015-12-16 22:50:35 +02:00
Dmitry Demidovsky
3fcb383f49 Changed allowDirs comparsion logic #497 2015-12-05 22:58:00 +03:00
Dmitry Demidovsky
3f02443c1f Added rtrim, removed preg_match 2015-12-05 17:51:58 +03:00
Dmitry Demidovsky
da70e92cc1 normalize paths before checking allowed dirs 2015-12-04 14:02:02 +03:00
Steve Clay
6998e61654 Merge pull request #476 from mrclay/symlinks_3
Allow specifying files via $min_symlinks paths
2015-12-02 12:14:30 -05:00
Elan Ruusamäe
27b5f4b2d0 handle more ng exit codes
comments from #87:

* cbed5408dd
For some reasons Nailgun thinks that it's server
broke the connection and returns 227 instead of 0
We'll just handle this here instead of fixing
the nailgun client itself.

* 7810d4a445
It also sometimes breaks on 229 on the devbox.
To complete this whole madness and made future
'fixes' easier I added this nice little array...
2015-11-20 14:04:14 +02:00
Elan Ruusamäe
5458206700 add Nailgun based ClosureCompiler 2015-11-20 13:54:42 +02:00
Elan Ruusamäe
35a9ab7d4a avoid unneccessary static calls 2015-11-19 17:56:05 +02:00
Elan Ruusamäe
0a74b9c4a6 refactor closure compiler class to allow extensibility 2015-11-19 17:52:11 +02:00
Elan Ruusamäe
8e85853af8 be compatible with php-5.3 2015-11-17 16:46:23 +02:00
Steve Clay
53a832fd90 Be clearer about missing params
Fixes #423
2015-09-29 15:59:14 -04:00
Steve Clay
6e8a656480 Add HTML5 block level elements to Minify_HTML
Fixes #424
2015-09-29 15:45:24 -04:00
Steve Clay
b7b26e3a83 A couple improvements
Show 400 if request is missing spec (instead of redirect)
Allow config.php to change factories for Minify and MinApp objects
These should've been separate commits, :(
2015-09-29 14:35:43 -04:00
Steve Clay
12e7a8d0dd Allow sources to have null contentType if serve is given one 2015-09-29 13:18:10 -04:00
Steve Clay
a566536f80 Make Minify::combine and mix_extra stuff operational (and disabled by default) 2015-09-29 13:17:31 -04:00
Steve Clay
f769e35233 Improve source factory constructor docs 2015-09-29 11:31:57 -04:00
Steve Clay
271d8ca5bf Don't assume all allowDir paths start with "//" 2015-09-29 11:31:28 -04:00
Steve Clay
a0d99f5be5 Make sure doc root rtrimmed in Env 2015-09-29 11:29:52 -04:00
Steve Clay
ed1d2d9baf Improve docs for Files controller 2015-09-29 11:29:05 -04:00
Steve Clay
e2efb342a8 Remove JSMin+ and old, unfinished CssCompressor port
JSMin+ was a good effort but is unmaintained and has collected several
reports of impractical memory usage for a project like this.
2015-09-29 10:38:22 -04:00
Steve Clay
fede83cd48 Version constant bump, disable min_extras, docs updates 2015-09-29 10:12:47 -04:00
Steve Clay
7c607ff932 Allow specifying files via $min_symlinks paths
If you have an alias/symlink like "//~name" => "/full/path", then you can
now serve with the more logical URL http://example.com/min/?f=~name/foo.css

Fixes #137
2015-09-28 21:50:32 -04:00
Steve Clay
0bc3769802 Make CSSmin the default CSS compressor 2015-09-28 20:32:56 -04:00