The files in this directory represent the default Minify setup designed to ease
integration with your site. This app will combine and minify your Javascript or
CSS files and serve them with HTTP compression and cache headers.
RECOMMENDED
It's recommended to edit config.php to set $min_cachePath to a writeable
(by PHP) directory on your system. This will improve performance.
GETTING STARTED
The quickest way to get started is to use the Minify URI Builder application
on your website: http://example.com/min/builder/
MINIFYING A SINGLE FILE
Let's say you want to serve this file:
http://example.com/wp-content/themes/default/default.css
Here's the "Minify URL" for this file:
http://example.com/min/?f=wp-content/themes/default/default.css
In other words, the "f" argument is set to the file path from root without the
initial "/". As CSS files may contain relative URIs, Minify will automatically
"fix" these by rewriting them as root relative.
COMBINING MULTIPLE FILES IN ONE DOWNLOAD
Separate the paths given to "f" with commas.
Let's say you have CSS files at these URLs:
http://example.com/scripts/jquery-1.2.6.js
http://example.com/scripts/site.js
You can combine these files through Minify by requesting this URL:
http://example.com/min/?f=scripts/jquery-1.2.6.js,scripts/site.js
SIMPLIFYING URLS WITH A BASE PATH
If you're combining files that share the same ancestor directory, you can use
the "b" argument to set the base directory for the "f" argument. Do not include
the leading or trailing "/" characters.
E.g., the following URLs will serve the exact same content:
http://example.com/min/?f=scripts/jquery-1.2.6.js,scripts/site.js,scripts/home.js
http://example.com/min/?b=scripts&f=jquery-1.2.6.js,site.js,home.js
MINIFY URLS IN HTML
In (X)HTML files, don't forget to replace any "&" characters with "&".
SPECIFYING ALLOWED DIRECTORIES
By default, Minify will serve any *.css/*.js files within the DOCUMENT_ROOT. If
you'd prefer to limit Minify's access to certain directories, set the
$min_serveOptions['minApp']['allowDirs'] array in config.php. E.g. to limit
to the /js and /themes/default directories, use:
$min_serveOptions['minApp']['allowDirs'] = array('//js', '//themes/default');
GROUPS: FASTER PERFORMANCE AND BETTER URLS
For the best performance, edit groupsConfig.php to pre-specify groups of files
to be combined under preset keys. E.g., here's an example configuration in
groupsConfig.php:
return array(
'js' => array('//js/Class.js', '//js/email.js')
);
This pre-selects the following files to be combined under the key "js":
http://example.com/js/Class.js
http://example.com/js/email.js
You can now serve these files with this simple URL:
http://example.com/min/?g=js
GROUPS: SPECIFYING FILES OUTSIDE THE DOC_ROOT
In the groupsConfig.php array, the "//" in the file paths is a shortcut for
the DOCUMENT_ROOT, but you can also specify paths from the root of the filesystem
or relative to the DOC_ROOT:
return array(
'js' => array(
'//js/file.js' // file within DOC_ROOT
,'//../file.js' // file in parent directory of DOC_ROOT
,'C:/Users/Steve/file.js' // file anywhere on filesystem
)
);
FAR-FUTURE EXPIRES HEADERS
Minify can send far-future (one year) Expires headers. To enable this you must
add a number to the querystring (e.g. /min/?g=js&1234 or /min/f=file.js&1234)
and alter it whenever a source file is changed. If you have a build process you
can use a build/source control revision number.
If you serve files as a group, you can use the utility function Minify_groupUri()
to get a "versioned" Minify URI for use in your HTML. E.g.:
<?php
// add /min/lib to your include_path first!
require $_SERVER['DOCUMENT_ROOT'] . '/min/utils.php';
$jsUri = Minify_groupUri('js');
echo "<script type='text/javascript' src='{$jsUri}'></script>";
DEBUG MODE
In debug mode, instead of compressing files, Minify sends combined files with
comments prepended to each line to show the line number in the original source
file. To enable this, set $min_allowDebugFlag to true in config.php and append
"&debug=1" to your URIs. E.g. /min/?f=script1.js,script2.js&debug=1
Known issue: files with comment-like strings/regexps can cause problems in this mode.
QUESTIONS?
http://groups.google.com/group/minify
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码—JavaScript Minifier(Minify).zip
共123个文件
php:59个
css:31个
js:19个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 123 浏览量
2022-11-22
02:36:52
上传
评论
收藏 190KB ZIP 举报
温馨提示
PHP实例开发源码—JavaScript Minifier(Minify).zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码—JavaScript Minifier(Minify).zip (123个子文件)
issue62.css 17KB
issue62.min.css 12KB
vladmirated.css 12KB
vladmirated.min.css 9KB
subsilver.css 7KB
subsilver.min.css 4KB
hacks.css 1KB
output.css 1KB
exp.css 837B
in.css 735B
paths_rewrite.css 735B
paths_prepend.css 683B
hacks.min.css 581B
selectors.css 559B
paths_rewrite.min.css 541B
styles.css 536B
minified.css 477B
selectors.min.css 466B
paths_prepend.min.css 426B
styles.min.css 372B
comments.css 278B
adjacent.css 171B
unusual_strings.css 171B
input.css 161B
tv.css 141B
adjacent.css 133B
comments.min.css 105B
unusual_strings.min.css 94B
issue89_2.css 83B
issue89_out.min.css 83B
issue89_1.css 82B
.htaccess 99B
before.html 3KB
before2.html 3KB
before.min.html 3KB
before2.min.html 3KB
test_js_in_browser.html 166B
jquery-1.2.3.js 94KB
lines_output.js 9KB
_index.js 8KB
QueryString.js 5KB
minified.js 2KB
before.js 2KB
bm.js 1KB
before.min.js 1KB
before.min_plus.js 1KB
email.js 558B
condcomm.js 209B
condcomm.min_plus.js 192B
lines_bugs.js 73B
issue74.js 44B
issue74.min.js 35B
issue74.min_plus.js 34B
issue73_2.js 23B
issue73_1.js 19B
rewriteTest.js 1B
JSMinPlus.php 46KB
FirePHP.php 43KB
Minify.php 20KB
ConditionalGet.php 11KB
JSMin.php 11KB
Encoder.php 10KB
test_HTTP_Encoder.php 9KB
UriRewriter.php 9KB
Compressor.php 8KB
HTML.php 8KB
test_Minify.php 7KB
index.php 7KB
Base.php 7KB
Source.php 5KB
Dir.php 5KB
ImportProcessor.php 5KB
config.php 5KB
MinApp.php 5KB
test_HTTP_ConditionalGet.php 5KB
Lines.php 4KB
YUICompressor.php 4KB
Version1.php 4KB
test_environment.php 3KB
test_JSMinPlus.php 3KB
CSS.php 3KB
Memcache.php 3KB
File.php 3KB
Groups.php 3KB
Build.php 3KB
CommentPreserver.php 3KB
APC.php 3KB
Page.php 2KB
utils.php 2KB
test_JSMin.php 2KB
test_Minify_HTML.php 2KB
_include.php 2KB
Files.php 2KB
test_Minify_CSS_UriRewriter.php 2KB
index.php 2KB
test_Minify_CSS.php 2KB
test_Minify_Cache_File.php 2KB
2.php 1KB
test_Minify_ImportProcessor.php 1KB
_inc.php 1KB
共 123 条
- 1
- 2
资源评论
易小侠
- 粉丝: 6451
- 资源: 9万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功