/** * Minifies the specified string and returns it. * * @param string $string JavaScript or CSS string to minify * @param string $type content type of the string (either Minify::TYPE_CSS or * Minify::TYPE_JS) * @return string minified string */ function _minify($string, $type = TYPE_JS) { return $type === TYPE_JS ? Minify::minifyJS($string) : Minify::minifyCSS($string); }
<?php die("DISABLED"); error_reporting(E_ALL); require_once "minify.php"; $oMin = new Minify(TYPE_JS); $aJs = array(); // jquery $aJs[] = file_get_contents(realpath('../jsfwk/jquery/core+ui/development-bundle/jquery-1.5.1.js')); // plugins $aJs[] = file_get_contents(realpath('../jsfwk/jquery/plugins/jquery.bind.js')); $aJs[] = file_get_contents(realpath('../jsfwk/jquery/plugins/jquery.betterjson.js')); $aJs[] = file_get_contents(realpath('../jsfwk/jquery/plugins/jquery.cookie.js')); $aJs[] = file_get_contents(realpath('../jsfwk/jquery/plugins/jquery.inherit.js')); //$aJs[] = file_get_contents(realpath('../jsfwk/json/json.js')); // framework $aJs[] = file_get_contents(realpath('../jsfwk/formidable/formidable.jquery.js')); $aJs[] = file_get_contents(realpath('../jsfwk/framework.js')); header("Content-Type: text/javascript;charset=utf-8"); $sNotice = <<<NOTICE /* \tNOTE: THIS IS MINIFIED VERSION OF FORMIDABLE JS \tFor regular set typoscript: config.tx_ameosformidable.minify.enabled=0 */ NOTICE; if (isset($_GET) && is_array($_GET) && array_key_exists("plain", $_GET) && $_GET["plain"] == 1) { echo implode($aJs, ""); } else { echo $sNotice . $oMin->minifyJS(implode($aJs, "")); } exit;