From 01b089d9be046db1253cb3bb90e8635b50fddd84 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 4 Dec 2009 12:36:00 -0500 Subject: Added minify plugin --- plugins/Minify/extlib/minify/min/builder/index.php | 182 +++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 plugins/Minify/extlib/minify/min/builder/index.php (limited to 'plugins/Minify/extlib/minify/min/builder/index.php') diff --git a/plugins/Minify/extlib/minify/min/builder/index.php b/plugins/Minify/extlib/minify/min/builder/index.php new file mode 100644 index 000000000..1b2098222 --- /dev/null +++ b/plugins/Minify/extlib/minify/min/builder/index.php @@ -0,0 +1,182 @@ + + + + + Minify URI Builder + + + + +

Note: Please set $min_cachePath +in /min/config.php to improve performance.

+ + +

Note: Your webserver does not seem to + support mod_rewrite (used in /min/.htaccess). Your Minify URIs will contain "?", which +may reduce the benefit of proxy cache servers.

+ +

Minify URI Builder

+ + + +
+ +

Create a list of Javascript or CSS files (or 1 is fine) you'd like to combine +and click [Update].

+ +
+
+ +
+ +

+ +
+ +

Minify URI

+

Place this URI in your HTML to serve the files above combined, minified, compressed and +with cache headers.

+ + + +
URI/min (opens in new window)
HTML
+ +

How to serve these files as a group

+

For the best performance you can serve these files as a pre-defined group with a URI +like: /min/?g=keyName

+

To do this, add a line like this to /min/groupsConfig.php:

+ +
return array(
+    ... your existing groups here ...
+
+);
+ +

Make sure to replace keyName with a unique key for this group.

+
+ +
+

Find URIs on a Page

+

You can use the bookmarklet below to fetch all CSS & Javascript URIs from a page +on your site. When you active it, this page will open in a new window with a list of +available URIs to add.

+ +

Create Minify URIs (right-click, add to bookmarks)

+
+ +

Combining CSS files that contain @import

+

If your CSS files contain @import declarations, Minify will not +remove them. Therefore, you will want to remove those that point to files already +in your list, and move any others to the top of the first file in your list +(imports below any styles will be ignored by browsers as invalid).

+

If you desire, you can use Minify URIs in imports and they will not be touched +by Minify. E.g. @import "/min/?g=css2";

+ +
+ +
+

Need help? Search or post to the Minify discussion list.

+

This app is minified :) view +source

+ + + + + + + ob_get_contents() + ,'id' => __FILE__ + ,'lastModifiedTime' => max( + // regenerate cache if either of these change + filemtime(__FILE__) + ,filemtime(dirname(__FILE__) . '/../config.php') + ) + ,'minifyAll' => true + ,'encodeOutput' => $encodeOutput +); +ob_end_clean(); + +set_include_path(dirname(__FILE__) . '/../lib' . PATH_SEPARATOR . get_include_path()); + +require 'Minify.php'; + +if (0 === stripos(PHP_OS, 'win')) { + Minify::setDocRoot(); // we may be on IIS +} +Minify::setCache(isset($min_cachePath) ? $min_cachePath : null); +Minify::$uploaderHoursBehind = $min_uploaderHoursBehind; + +Minify::serve('Page', $serveOpts); -- cgit v1.2.3-54-g00ecf