diff options
| author | Jano Slota <jano@alokal.eu> | 2014-05-05 22:55:36 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-05-07 11:17:32 +0200 |
| commit | c25b8f01c560ca97ca8a9dc217b495966aaa4d7f (patch) | |
| tree | 54d4c0aaa98a7cb581832094de4e707c9ae9ac93 /inc/lib/minify/Minify.php | |
| parent | 593560956c629fb2df9b97b5afe9c1eb2666652b (diff) | |
Updated minify, jQuery, MixItUp and Tooltipster
Diffstat (limited to 'inc/lib/minify/Minify.php')
| -rwxr-xr-x | inc/lib/minify/Minify.php | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/inc/lib/minify/Minify.php b/inc/lib/minify/Minify.php index 9634f221..2b38f89b 100755 --- a/inc/lib/minify/Minify.php +++ b/inc/lib/minify/Minify.php @@ -3,11 +3,6 @@ * Class Minify * @package Minify */ - -/** - * Minify_Source - */ -require_once 'Minify/Source.php'; /** * Minify - Combines, minifies, and caches JavaScript and CSS files on demand. @@ -29,7 +24,7 @@ require_once 'Minify/Source.php'; */ class Minify { - const VERSION = '2.1.5'; + const VERSION = '2.2.0'; const TYPE_CSS = 'text/css'; const TYPE_HTML = 'text/html'; // there is some debate over the ideal JS Content-Type, but this is the @@ -85,7 +80,6 @@ class Minify { public static function setCache($cache = '', $fileLocking = true) { if (is_string($cache)) { - require_once 'Minify/Cache/File.php'; self::$_cache = new Minify_Cache_File($cache, $fileLocking); } else { self::$_cache = $cache; @@ -161,9 +155,11 @@ class Minify { * * @param array $options controller/serve options * - * @return mixed null, or, if the 'quiet' option is set to true, an array + * @return null|array if the 'quiet' option is set to true, an array * with keys "success" (bool), "statusCode" (int), "content" (string), and * "headers" (array). + * + * @throws Exception */ public static function serve($controller, $options = array()) { @@ -174,10 +170,6 @@ class Minify { if (is_string($controller)) { // make $controller into object $class = 'Minify_Controller_' . $controller; - if (! class_exists($class, false)) { - require_once "Minify/Controller/" - . str_replace('_', '/', $controller) . ".php"; - } $controller = new $class(); /* @var Minify_Controller_Base $controller */ } @@ -219,8 +211,7 @@ class Minify { $contentEncoding = self::$_options['encodeMethod']; } else { // sniff request header - require_once 'HTTP/Encoder.php'; - // depending on what the client accepts, $contentEncoding may be + // depending on what the client accepts, $contentEncoding may be // 'x-gzip' while our internal encodeMethod is 'gzip'. Calling // getAcceptedEncoding(false, false) leaves out compress and deflate as options. list(self::$_options['encodeMethod'], $contentEncoding) = HTTP_Encoder::getAcceptedEncoding(false, false); @@ -231,7 +222,6 @@ class Minify { } // check client cache - require_once 'HTTP/ConditionalGet.php'; $cgOptions = array( 'lastModifiedTime' => self::$_options['lastModifiedTime'] ,'isPublic' => self::$_options['isPublic'] @@ -300,7 +290,7 @@ class Minify { throw $e; } self::$_cache->store($cacheId, $content); - if (function_exists('gzencode')) { + if (function_exists('gzencode') && self::$_options['encodeMethod']) { self::$_cache->store($cacheId . '.gz', gzencode($content, self::$_options['encodeLevel'])); } } @@ -451,7 +441,7 @@ class Minify { /** * Set up sources to use Minify_Lines * - * @param array $sources Minify_Source instances + * @param Minify_Source[] $sources Minify_Source instances */ protected static function _setupDebug($sources) { @@ -468,6 +458,8 @@ class Minify { * Combines sources and minifies the result. * * @return string + * + * @throws Exception */ protected static function _combineMinify() { @@ -526,7 +518,6 @@ class Minify { $imploded = implode($implodeSeparator, $groupToProcessTogether); $groupToProcessTogether = array(); if ($lastMinifier) { - self::$_controller->loadMinifier($lastMinifier); try { $content[] = call_user_func($lastMinifier, $imploded, $lastOptions); } catch (Exception $e) { @@ -574,7 +565,7 @@ class Minify { { $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', self::$_controller->selectionId); $name = preg_replace('/\\.+/', '.', $name); - $name = substr($name, 0, 200 - 34 - strlen($prefix)); + $name = substr($name, 0, 100 - 34 - strlen($prefix)); $md5 = md5(serialize(array( Minify_Source::getDigest(self::$_controller->sources) ,self::$_options['minifiers'] |
