From 0218e5ca1fc589db532df515f0f406f6bf6d0fe0 Mon Sep 17 00:00:00 2001 From: yukulele Date: Tue, 6 Nov 2012 15:35:43 +0100 Subject: [PATCH 01/11] Update smartoptimizer/minifiers/css.php fix bug when attached file not exist --- smartoptimizer/minifiers/css.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/smartoptimizer/minifiers/css.php b/smartoptimizer/minifiers/css.php index 0a71b78..b6d00a2 100644 --- a/smartoptimizer/minifiers/css.php +++ b/smartoptimizer/minifiers/css.php @@ -14,9 +14,12 @@ function convertUrl($url, $count) if (preg_match('@^[^/]+:@', $url)) return $url; $fileType = substr(strrchr($url, '.'), 1); - if (isset($mimeTypes[$fileType])) $mimeType = $mimeTypes[$fileType]; - elseif (function_exists('mime_content_type')) $mimeType = mime_content_type($url); - else $mimeType = null; + if (isset($mimeTypes[$fileType])) + $mimeType = $mimeTypes[$fileType]; + elseif (function_exists('mime_content_type') && file_exists($fileDir.$url)) + $mimeType = mime_content_type($fileDir.$url); + else + $mimeType = null; if (!$settings['embed'] || !file_exists($fileDir.$url) || From e97e626306ade42c64142781921308ef8ff982b4 Mon Sep 17 00:00:00 2001 From: Narimm Date: Fri, 29 Nov 2013 22:15:58 +1000 Subject: [PATCH 02/11] merged in yukele's changes to stop file not existing errors --- smartoptimizer/minifiers/css.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/smartoptimizer/minifiers/css.php b/smartoptimizer/minifiers/css.php index b6d00a2..0a71b78 100644 --- a/smartoptimizer/minifiers/css.php +++ b/smartoptimizer/minifiers/css.php @@ -14,12 +14,9 @@ function convertUrl($url, $count) if (preg_match('@^[^/]+:@', $url)) return $url; $fileType = substr(strrchr($url, '.'), 1); - if (isset($mimeTypes[$fileType])) - $mimeType = $mimeTypes[$fileType]; - elseif (function_exists('mime_content_type') && file_exists($fileDir.$url)) - $mimeType = mime_content_type($fileDir.$url); - else - $mimeType = null; + if (isset($mimeTypes[$fileType])) $mimeType = $mimeTypes[$fileType]; + elseif (function_exists('mime_content_type')) $mimeType = mime_content_type($url); + else $mimeType = null; if (!$settings['embed'] || !file_exists($fileDir.$url) || From 912e24ab11e25d32a104ee3da4a36273775ea2ae Mon Sep 17 00:00:00 2001 From: Narimm Date: Fri, 29 Nov 2013 23:14:54 +1000 Subject: [PATCH 03/11] Added support for custom minifiers and packer.js Conflicts: smartoptimizer/config.php smartoptimizer/index.php --- smartoptimizer/config.php | 23 +- smartoptimizer/index.php | 39 +- smartoptimizer/minifiers/packer.php | 746 ++++++++++++++++++++++++++++ 3 files changed, 794 insertions(+), 14 deletions(-) create mode 100644 smartoptimizer/minifiers/packer.php diff --git a/smartoptimizer/config.php b/smartoptimizer/config.php index 92fbdbe..a05043b 100644 --- a/smartoptimizer/config.php +++ b/smartoptimizer/config.php @@ -3,9 +3,8 @@ * SmartOptimizer Configuration File */ - //base dir (a relative path to the base directory) -$settings['baseDir'] = '../'; +$settings['baseDir'] = ''; //Encoding of your js and css files. (utf-8 or iso-8859-1) $settings['charSet'] = 'utf-8'; @@ -28,7 +27,7 @@ //use this to set file concatenation On or Off $settings['concatenate'] = true; -//separator for files to be concatenated +//separator for files to be concatenated. Tip: Don't use '.' if you use groups and name them like suggested. $settings['separator'] = ','; //specifies whether to emebed files included in css files using the data URI scheme or not @@ -57,4 +56,20 @@ //Setting this to false will force the browser to use cached files without checking for changes. $settings['clientCacheCheck'] = false; -?> + +//Minifier to use when parsing js files. Add yours in /minifiers directory, and implement function minify_js($text_to_minify) +$settings['jsMinifier'] = 'packer'; + +//Minifier to use when parsing css files. Add yours in /minifiers directory, and implement function minify_css($text_to_minify) +$settings['cssMinifier'] = 'css'; + +//To use groups effectively, include your files with absolute paths. Define constants for easy access. +define('MY_JS_DIR', $_SERVER['DOCUMENT_ROOT'] . '/tkitt/js/'); +define('MY_CSS_DIR', $_SERVER['DOCUMENT_ROOT'] . '/tkitt/css/'); + +//groups configuration. Call a group by using /path/to/smartoptimizer/?group.group_name. +//Tip: If you use 'test.js' as your group name, you'll get a nifty file name like 'group.test.js' +$settings['groups'] = array( + 'test.js' => array(MY_JS_DIR.'test.js', MY_JS_DIR.'test2.js'), + 'test.css' => array(MY_JS_DIR.'style.css', MY_JS_DIR.'print.css') +); \ No newline at end of file diff --git a/smartoptimizer/index.php b/smartoptimizer/index.php index d4c0e7d..7923824 100644 --- a/smartoptimizer/index.php +++ b/smartoptimizer/index.php @@ -31,6 +31,8 @@ 'cachePrefix' => 'so_', 'clientCache' => true, 'clientCacheCheck' => false, + 'jsMinifier' => 'js', + 'cssMinifier' => 'css' ); //mime types @@ -98,10 +100,10 @@ function gmdatestr($time = null) { } function filesmtime() { - global $files, $fileType; + global $files, $fileMinifier; static $filesmtime; if ($filesmtime) return $filesmtime; - $filesmtime = max(@filemtime("minifiers/$fileType.php"), filemtime('index.php'), filemtime('config.php')); + $filesmtime = max(@filemtime("minifiers/$fileMinifier.php"), filemtime('index.php'), filemtime('config.php')); foreach ($files as $file) { if (!file_exists($file)) debugExit("File not found ($file)."); $filesmtime = max(filemtime($file), $filesmtime); @@ -113,15 +115,30 @@ function filesmtime() { list($query) = explode('?', urldecode($_SERVER['QUERY_STRING'])); -if (preg_match('/^\/?(.+\/)?(.+)$/', $query, $matchResult)) { - $fileNames = $matchResult[2]; - $fileDir = $settings['baseDir'].$matchResult[1]; -} else debugExit("Invalid file name ($query)"); +if(isset($settings['groups']) && substr($query, 0, 6) == 'group.'){ + //we have a pre-defined group to include + $group_name = str_replace('group.','',$query); + if(isset($settings['groups'][$group_name])) { + $fileNames = $settings['groups'][$group_name]; + $fileDir = ''; + } + else debugExit("Group ($group_name) not set. Please edit config."); +} else { + if (preg_match('/^\/?(.+\/)?(.+)$/', $query, $matchResult)) { + $fileNames = $matchResult[2]; + $fileDir = $settings['baseDir'].$matchResult[1]; + } else debugExit("Invalid file name ($query)"); +} -if (strpos(realpath($fileDir), realpath($settings['baseDir'])) !== 0) debugExit("File is out of base directory."); +//if (strpos(realpath($fileDir), realpath($settings['baseDir'])) !== 0) debugExit("File is out of base directory."); if ($settings['concatenate']) { - $files = explode($settings['separator'], $fileNames); + if(!is_array($fileNames)){ + $files = explode($settings['separator'], $fileNames); + } + else{ + $files = $fileNames; + } $settings['concatenate'] = count($files) > 1; } else $files = array($fileNames); @@ -138,6 +155,8 @@ function filesmtime() { } $fileType = $fileTypes[0]; +$fileMinifier = $settings[$fileType.'Minifier']; +if(!file_exists('minifiers/'.$fileMinifier.'.php')) debugExit($fileType.'Minifier not found. Please create "minifiers/'.$fileMinifier.'.php" or change minifier in config.php'); if (!isset($mimeTypes[$fileType])) debugExit("Unsupported file type ($fileType)"); header("Content-Type: {$mimeTypes[$fileType]}; charset=".$settings['charSet']); @@ -150,7 +169,7 @@ function_exists('gzencode')); if ($settings['gzip']) header("Content-Encoding: gzip"); -$settings['minify'] = $settings['minify'] && file_exists('minifiers/'.$fileType.'.php'); +$settings['minify'] = $settings['minify'] && file_exists('minifiers/'.$fileMinifier.'.php'); $settings['embed'] = $settings['embed'] && $fileType == 'css' && (!preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT']) || preg_match('/msie 8|opera/i', $_SERVER['HTTP_USER_AGENT'])); $settings['serverCache'] = $settings['serverCache'] && ($settings['minify'] || $settings['gzip'] || $settings['concatenate'] || $settings['embed']); @@ -177,7 +196,7 @@ function_exists('gzencode')); } else headerNoCache(); if ($generateContent) { - if ($settings['minify']) include('minifiers/'.$fileType.'.php'); + if ($settings['minify']) include('minifiers/'.$fileMinifier.'.php'); $content = array(); foreach ($files as $file) (($content[] = @file_get_contents($file)) !== false) || debugExit("File not found ($file)."); $content = implode("\n", $content); diff --git a/smartoptimizer/minifiers/packer.php b/smartoptimizer/minifiers/packer.php new file mode 100644 index 0000000..d31628e --- /dev/null +++ b/smartoptimizer/minifiers/packer.php @@ -0,0 +1,746 @@ +pack(); + * + * or + * + * $myPacker = new JavaScriptPacker($script, 'Normal', true, false); + * $packed = $myPacker->pack(); + * + * or (default values) + * + * $myPacker = new JavaScriptPacker($script); + * $packed = $myPacker->pack(); + * + * + * params of the constructor : + * $script: the JavaScript to pack, string. + * $encoding: level of encoding, int or string : + * 0,10,62,95 or 'None', 'Numeric', 'Normal', 'High ASCII'. + * default: 62. + * $fastDecode: include the fast decoder in the packed result, boolean. + * default : true. + * $specialChars: if you are flagged your private and local variables + * in the script, boolean. + * default: false. + * + * The pack() method return the compressed JavasScript, as a string. + * + * see http://dean.edwards.name/packer/usage/ for more information. + * + * Notes : + * # need PHP 5 . Tested with PHP 5.1.2, 5.1.3, 5.1.4, 5.2.3 + * + * # The packed result may be different than with the Dean Edwards + * version, but with the same length. The reason is that the PHP + * function usort to sort array don't necessarily preserve the + * original order of two equal member. The Javascript sort function + * in fact preserve this order (but that's not require by the + * ECMAScript standard). So the encoded keywords order can be + * different in the two results. + * + * # Be careful with the 'High ASCII' Level encoding if you use + * UTF-8 in your files... + */ + + +class JavaScriptPacker { + // constants + const IGNORE = '$1'; + + // validate parameters + private $_script = ''; + private $_encoding = 62; + private $_fastDecode = true; + private $_specialChars = false; + + private $LITERAL_ENCODING = array( + 'None' => 0, + 'Numeric' => 10, + 'Normal' => 62, + 'High ASCII' => 95 + ); + + public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false) + { + $this->_script = $_script . "\n"; + if (array_key_exists($_encoding, $this->LITERAL_ENCODING)) + $_encoding = $this->LITERAL_ENCODING[$_encoding]; + $this->_encoding = min((int)$_encoding, 95); + $this->_fastDecode = $_fastDecode; + $this->_specialChars = $_specialChars; + } + + public function pack() { + $this->_addParser('_basicCompression'); + if ($this->_specialChars) + $this->_addParser('_encodeSpecialChars'); + if ($this->_encoding) + $this->_addParser('_encodeKeywords'); + + // go! + return $this->_pack($this->_script); + } + + // apply all parsing routines + private function _pack($script) { + for ($i = 0; isset($this->_parsers[$i]); $i++) { + $script = call_user_func(array(&$this,$this->_parsers[$i]), $script); + } + return $script; + } + + // keep a list of parsing functions, they'll be executed all at once + private $_parsers = array(); + private function _addParser($parser) { + $this->_parsers[] = $parser; + } + + // zero encoding - just removal of white space and comments + private function _basicCompression($script) { + $parser = new ParseMaster(); + // make safe + $parser->escapeChar = '\\'; + // protect strings + $parser->add('/\'[^\'\\n\\r]*\'/', self::IGNORE); + $parser->add('/"[^"\\n\\r]*"/', self::IGNORE); + // remove comments + $parser->add('/\\/\\/[^\\n\\r]*[\\n\\r]/', ' '); + $parser->add('/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//', ' '); + // protect regular expressions + $parser->add('/\\s+(\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?)/', '$2'); // IGNORE + $parser->add('/[^\\w\\x24\\/\'"*)\\?:]\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?/', self::IGNORE); + // remove: ;;; doSomething(); + if ($this->_specialChars) $parser->add('/;;;[^\\n\\r]+[\\n\\r]/'); + // remove redundant semi-colons + $parser->add('/\\(;;\\)/', self::IGNORE); // protect for (;;) loops + $parser->add('/;+\\s*([};])/', '$2'); + // apply the above + $script = $parser->exec($script); + + // remove white-space + $parser->add('/(\\b|\\x24)\\s+(\\b|\\x24)/', '$2 $3'); + $parser->add('/([+\\-])\\s+([+\\-])/', '$2 $3'); + $parser->add('/\\s+/', ''); + // done + return $parser->exec($script); + } + + private function _encodeSpecialChars($script) { + $parser = new ParseMaster(); + // replace: $name -> n, $$name -> na + $parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/', + array('fn' => '_replace_name') + ); + // replace: _name -> _0, double-underscore (__name) is ignored + $regexp = '/\\b_[A-Za-z\\d]\\w*/'; + // build the word list + $keywords = $this->_analyze($script, $regexp, '_encodePrivate'); + // quick ref + $encoded = $keywords['encoded']; + + $parser->add($regexp, + array( + 'fn' => '_replace_encoded', + 'data' => $encoded + ) + ); + return $parser->exec($script); + } + + private function _encodeKeywords($script) { + // escape high-ascii values already in the script (i.e. in strings) + if ($this->_encoding > 62) + $script = $this->_escape95($script); + // create the parser + $parser = new ParseMaster(); + $encode = $this->_getEncoder($this->_encoding); + // for high-ascii, don't encode single character low-ascii + $regexp = ($this->_encoding > 62) ? '/\\w\\w+/' : '/\\w+/'; + // build the word list + $keywords = $this->_analyze($script, $regexp, $encode); + $encoded = $keywords['encoded']; + + // encode + $parser->add($regexp, + array( + 'fn' => '_replace_encoded', + 'data' => $encoded + ) + ); + if (empty($script)) return $script; + else { + //$res = $parser->exec($script); + //$res = $this->_bootStrap($res, $keywords); + //return $res; + return $this->_bootStrap($parser->exec($script), $keywords); + } + } + + private function _analyze($script, $regexp, $encode) { + // analyse + // retreive all words in the script + $all = array(); + preg_match_all($regexp, $script, $all); + $_sorted = array(); // list of words sorted by frequency + $_encoded = array(); // dictionary of word->encoding + $_protected = array(); // instances of "protected" words + $all = $all[0]; // simulate the javascript comportement of global match + if (!empty($all)) { + $unsorted = array(); // same list, not sorted + $protected = array(); // "protected" words (dictionary of word->"word") + $value = array(); // dictionary of charCode->encoding (eg. 256->ff) + $this->_count = array(); // word->count + $i = count($all); $j = 0; //$word = null; + // count the occurrences - used for sorting later + do { + --$i; + $word = '$' . $all[$i]; + if (!isset($this->_count[$word])) { + $this->_count[$word] = 0; + $unsorted[$j] = $word; + // make a dictionary of all of the protected words in this script + // these are words that might be mistaken for encoding + //if (is_string($encode) && method_exists($this, $encode)) + $values[$j] = call_user_func(array(&$this, $encode), $j); + $protected['$' . $values[$j]] = $j++; + } + // increment the word counter + $this->_count[$word]++; + } while ($i > 0); + // prepare to sort the word list, first we must protect + // words that are also used as codes. we assign them a code + // equivalent to the word itself. + // e.g. if "do" falls within our encoding range + // then we store keywords["do"] = "do"; + // this avoids problems when decoding + $i = count($unsorted); + do { + $word = $unsorted[--$i]; + if (isset($protected[$word]) /*!= null*/) { + $_sorted[$protected[$word]] = substr($word, 1); + $_protected[$protected[$word]] = true; + $this->_count[$word] = 0; + } + } while ($i); + + // sort the words by frequency + // Note: the javascript and php version of sort can be different : + // in php manual, usort : + // " If two members compare as equal, + // their order in the sorted array is undefined." + // so the final packed script is different of the Dean's javascript version + // but equivalent. + // the ECMAscript standard does not guarantee this behaviour, + // and thus not all browsers (e.g. Mozilla versions dating back to at + // least 2003) respect this. + usort($unsorted, array(&$this, '_sortWords')); + $j = 0; + // because there are "protected" words in the list + // we must add the sorted words around them + do { + if (!isset($_sorted[$i])) + $_sorted[$i] = substr($unsorted[$j++], 1); + $_encoded[$_sorted[$i]] = $values[$i]; + } while (++$i < count($unsorted)); + } + return array( + 'sorted' => $_sorted, + 'encoded' => $_encoded, + 'protected' => $_protected); + } + + private $_count = array(); + private function _sortWords($match1, $match2) { + return $this->_count[$match2] - $this->_count[$match1]; + } + + // build the boot function used for loading and decoding + private function _bootStrap($packed, $keywords) { + $ENCODE = $this->_safeRegExp('$encode\\($count\\)'); + + // $packed: the packed script + $packed = "'" . $this->_escape($packed) . "'"; + + // $ascii: base for encoding + $ascii = min(count($keywords['sorted']), $this->_encoding); + if ($ascii == 0) $ascii = 1; + + // $count: number of words contained in the script + $count = count($keywords['sorted']); + + // $keywords: list of words contained in the script + foreach ($keywords['protected'] as $i=>$value) { + $keywords['sorted'][$i] = ''; + } + // convert from a string to an array + ksort($keywords['sorted']); + $keywords = "'" . implode('|',$keywords['sorted']) . "'.split('|')"; + + $encode = ($this->_encoding > 62) ? '_encode95' : $this->_getEncoder($ascii); + $encode = $this->_getJSFunction($encode); + $encode = preg_replace('/_encoding/','$ascii', $encode); + $encode = preg_replace('/arguments\\.callee/','$encode', $encode); + $inline = '\\$count' . ($ascii > 10 ? '.toString(\\$ascii)' : ''); + + // $decode: code snippet to speed up decoding + if ($this->_fastDecode) { + // create the decoder + $decode = $this->_getJSFunction('_decodeBody'); + if ($this->_encoding > 62) + $decode = preg_replace('/\\\\w/', '[\\xa1-\\xff]', $decode); + // perform the encoding inline for lower ascii values + elseif ($ascii < 36) + $decode = preg_replace($ENCODE, $inline, $decode); + // special case: when $count==0 there are no keywords. I want to keep + // the basic shape of the unpacking funcion so i'll frig the code... + if ($count == 0) + $decode = preg_replace($this->_safeRegExp('($count)\\s*=\\s*1'), '$1=0', $decode, 1); + } + + // boot function + $unpack = $this->_getJSFunction('_unpack'); + if ($this->_fastDecode) { + // insert the decoder + $this->buffer = $decode; + $unpack = preg_replace_callback('/\\{/', array(&$this, '_insertFastDecode'), $unpack, 1); + } + $unpack = preg_replace('/"/', "'", $unpack); + if ($this->_encoding > 62) { // high-ascii + // get rid of the word-boundaries for regexp matches + $unpack = preg_replace('/\'\\\\\\\\b\'\s*\\+|\\+\s*\'\\\\\\\\b\'/', '', $unpack); + } + if ($ascii > 36 || $this->_encoding > 62 || $this->_fastDecode) { + // insert the encode function + $this->buffer = $encode; + $unpack = preg_replace_callback('/\\{/', array(&$this, '_insertFastEncode'), $unpack, 1); + } else { + // perform the encoding inline + $unpack = preg_replace($ENCODE, $inline, $unpack); + } + // pack the boot function too + $unpackPacker = new JavaScriptPacker($unpack, 0, false, true); + $unpack = $unpackPacker->pack(); + + // arguments + $params = array($packed, $ascii, $count, $keywords); + if ($this->_fastDecode) { + $params[] = 0; + $params[] = '{}'; + } + $params = implode(',', $params); + + // the whole thing + return 'eval(' . $unpack . '(' . $params . "))\n"; + } + + private $buffer; + private function _insertFastDecode($match) { + return '{' . $this->buffer . ';'; + } + private function _insertFastEncode($match) { + return '{$encode=' . $this->buffer . ';'; + } + + // mmm.. ..which one do i need ?? + private function _getEncoder($ascii) { + return $ascii > 10 ? $ascii > 36 ? $ascii > 62 ? + '_encode95' : '_encode62' : '_encode36' : '_encode10'; + } + + // zero encoding + // characters: 0123456789 + private function _encode10($charCode) { + return $charCode; + } + + // inherent base36 support + // characters: 0123456789abcdefghijklmnopqrstuvwxyz + private function _encode36($charCode) { + return base_convert($charCode, 10, 36); + } + + // hitch a ride on base36 and add the upper case alpha characters + // characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + private function _encode62($charCode) { + $res = ''; + if ($charCode >= $this->_encoding) { + $res = $this->_encode62((int)($charCode / $this->_encoding)); + } + $charCode = $charCode % $this->_encoding; + + if ($charCode > 35) + return $res . chr($charCode + 29); + else + return $res . base_convert($charCode, 10, 36); + } + + // use high-ascii values + // characters: ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ + private function _encode95($charCode) { + $res = ''; + if ($charCode >= $this->_encoding) + $res = $this->_encode95($charCode / $this->_encoding); + + return $res . chr(($charCode % $this->_encoding) + 161); + } + + private function _safeRegExp($string) { + return '/'.preg_replace('/\$/', '\\\$', $string).'/'; + } + + private function _encodePrivate($charCode) { + return "_" . $charCode; + } + + // protect characters used by the parser + private function _escape($script) { + return preg_replace('/([\\\\\'])/', '\\\$1', $script); + } + + // protect high-ascii characters already in the script + private function _escape95($script) { + return preg_replace_callback( + '/[\\xa1-\\xff]/', + array(&$this, '_escape95Bis'), + $script + ); + } + private function _escape95Bis($match) { + return '\x'.((string)dechex(ord($match))); + } + + + private function _getJSFunction($aName) { + if (defined('self::JSFUNCTION'.$aName)) + return constant('self::JSFUNCTION'.$aName); + else + return ''; + } + + // JavaScript Functions used. + // Note : In Dean's version, these functions are converted + // with 'String(aFunctionName);'. + // This internal conversion complete the original code, ex : + // 'while (aBool) anAction();' is converted to + // 'while (aBool) { anAction(); }'. + // The JavaScript functions below are corrected. + + // unpacking function - this is the boot strap function + // data extracted from this packing routine is passed to + // this function when decoded in the target + // NOTE ! : without the ';' final. + const JSFUNCTION_unpack = + +'function($packed, $ascii, $count, $keywords, $encode, $decode) { + while ($count--) { + if ($keywords[$count]) { + $packed = $packed.replace(new RegExp(\'\\\\b\' + $encode($count) + \'\\\\b\', \'g\'), $keywords[$count]); + } + } + return $packed; +}'; +/* +'function($packed, $ascii, $count, $keywords, $encode, $decode) { + while ($count--) + if ($keywords[$count]) + $packed = $packed.replace(new RegExp(\'\\\\b\' + $encode($count) + \'\\\\b\', \'g\'), $keywords[$count]); + return $packed; +}'; +*/ + + // code-snippet inserted into the unpacker to speed up decoding + const JSFUNCTION_decodeBody = +//_decode = function() { +// does the browser support String.replace where the +// replacement value is a function? + +' if (!\'\'.replace(/^/, String)) { + // decode all the values we need + while ($count--) { + $decode[$encode($count)] = $keywords[$count] || $encode($count); + } + // global replacement function + $keywords = [function ($encoded) {return $decode[$encoded]}]; + // generic match + $encode = function () {return \'\\\\w+\'}; + // reset the loop counter - we are now doing a global replace + $count = 1; + } +'; +//}; +/* +' if (!\'\'.replace(/^/, String)) { + // decode all the values we need + while ($count--) $decode[$encode($count)] = $keywords[$count] || $encode($count); + // global replacement function + $keywords = [function ($encoded) {return $decode[$encoded]}]; + // generic match + $encode = function () {return\'\\\\w+\'}; + // reset the loop counter - we are now doing a global replace + $count = 1; + }'; +*/ + + // zero encoding + // characters: 0123456789 + const JSFUNCTION_encode10 = +'function($charCode) { + return $charCode; +}';//;'; + + // inherent base36 support + // characters: 0123456789abcdefghijklmnopqrstuvwxyz + const JSFUNCTION_encode36 = +'function($charCode) { + return $charCode.toString(36); +}';//;'; + + // hitch a ride on base36 and add the upper case alpha characters + // characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + const JSFUNCTION_encode62 = +'function($charCode) { + return ($charCode < _encoding ? \'\' : arguments.callee(parseInt($charCode / _encoding))) + + (($charCode = $charCode % _encoding) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36)); +}'; + + // use high-ascii values + // characters: ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ + const JSFUNCTION_encode95 = +'function($charCode) { + return ($charCode < _encoding ? \'\' : arguments.callee($charCode / _encoding)) + + String.fromCharCode($charCode % _encoding + 161); +}'; + +} + + +class ParseMaster { + public $ignoreCase = false; + public $escapeChar = ''; + + // constants + const EXPRESSION = 0; + const REPLACEMENT = 1; + const LENGTH = 2; + + // used to determine nesting levels + private $GROUPS = '/\\(/';//g + private $SUB_REPLACE = '/\\$\\d/'; + private $INDEXED = '/^\\$\\d+$/'; + private $TRIM = '/([\'"])\\1\\.(.*)\\.\\1\\1$/'; + private $ESCAPE = '/\\\./';//g + private $QUOTE = '/\'/'; + private $DELETED = '/\\x01[^\\x01]*\\x01/';//g + + public function add($expression, $replacement = '') { + // count the number of sub-expressions + // - add one because each pattern is itself a sub-expression + $length = 1 + preg_match_all($this->GROUPS, $this->_internalEscape((string)$expression), $out); + + // treat only strings $replacement + if (is_string($replacement)) { + // does the pattern deal with sub-expressions? + if (preg_match($this->SUB_REPLACE, $replacement)) { + // a simple lookup? (e.g. "$2") + if (preg_match($this->INDEXED, $replacement)) { + // store the index (used for fast retrieval of matched strings) + $replacement = (int)(substr($replacement, 1)) - 1; + } else { // a complicated lookup (e.g. "Hello $2 $1") + // build a function to do the lookup + $quote = preg_match($this->QUOTE, $this->_internalEscape($replacement)) + ? '"' : "'"; + $replacement = array( + 'fn' => '_backReferences', + 'data' => array( + 'replacement' => $replacement, + 'length' => $length, + 'quote' => $quote + ) + ); + } + } + } + // pass the modified arguments + if (!empty($expression)) $this->_add($expression, $replacement, $length); + else $this->_add('/^$/', $replacement, $length); + } + + public function exec($string) { + // execute the global replacement + $this->_escaped = array(); + + // simulate the _patterns.toSTring of Dean + $regexp = '/'; + foreach ($this->_patterns as $reg) { + $regexp .= '(' . substr($reg[self::EXPRESSION], 1, -1) . ')|'; + } + $regexp = substr($regexp, 0, -1) . '/'; + $regexp .= ($this->ignoreCase) ? 'i' : ''; + + $string = $this->_escape($string, $this->escapeChar); + $string = preg_replace_callback( + $regexp, + array( + &$this, + '_replacement' + ), + $string + ); + $string = $this->_unescape($string, $this->escapeChar); + + return preg_replace($this->DELETED, '', $string); + } + + public function reset() { + // clear the patterns collection so that this object may be re-used + $this->_patterns = array(); + } + + // private + private $_escaped = array(); // escaped characters + private $_patterns = array(); // patterns stored by index + + // create and add a new pattern to the patterns collection + private function _add() { + $arguments = func_get_args(); + $this->_patterns[] = $arguments; + } + + // this is the global replace function (it's quite complicated) + private function _replacement($arguments) { + if (empty($arguments)) return ''; + + $i = 1; $j = 0; + // loop through the patterns + while (isset($this->_patterns[$j])) { + $pattern = $this->_patterns[$j++]; + // do we have a result? + if (isset($arguments[$i]) && ($arguments[$i] != '')) { + $replacement = $pattern[self::REPLACEMENT]; + + if (is_array($replacement) && isset($replacement['fn'])) { + + if (isset($replacement['data'])) $this->buffer = $replacement['data']; + return call_user_func(array(&$this, $replacement['fn']), $arguments, $i); + + } elseif (is_int($replacement)) { + return $arguments[$replacement + $i]; + + } + $delete = ($this->escapeChar == '' || + strpos($arguments[$i], $this->escapeChar) === false) + ? '' : "\x01" . $arguments[$i] . "\x01"; + return $delete . $replacement; + + // skip over references to sub-expressions + } else { + $i += $pattern[self::LENGTH]; + } + } + } + + private function _backReferences($match, $offset) { + $replacement = $this->buffer['replacement']; + $quote = $this->buffer['quote']; + $i = $this->buffer['length']; + while ($i) { + $replacement = str_replace('$'.$i--, $match[$offset + $i], $replacement); + } + return $replacement; + } + + private function _replace_name($match, $offset){ + $length = strlen($match[$offset + 2]); + $start = $length - max($length - strlen($match[$offset + 3]), 0); + return substr($match[$offset + 1], $start, $length) . $match[$offset + 4]; + } + + private function _replace_encoded($match, $offset) { + return $this->buffer[$match[$offset]]; + } + + + // php : we cannot pass additional data to preg_replace_callback, + // and we cannot use &$this in create_function, so let's go to lower level + private $buffer; + + // encode escaped characters + private function _escape($string, $escapeChar) { + if ($escapeChar) { + $this->buffer = $escapeChar; + return preg_replace_callback( + '/\\' . $escapeChar . '(.)' .'/', + array(&$this, '_escapeBis'), + $string + ); + + } else { + return $string; + } + } + private function _escapeBis($match) { + $this->_escaped[] = $match[1]; + return $this->buffer; + } + + // decode escaped characters + private function _unescape($string, $escapeChar) { + if ($escapeChar) { + $regexp = '/'.'\\'.$escapeChar.'/'; + $this->buffer = array('escapeChar'=> $escapeChar, 'i' => 0); + return preg_replace_callback + ( + $regexp, + array(&$this, '_unescapeBis'), + $string + ); + + } else { + return $string; + } + } + private function _unescapeBis() { + if (isset($this->_escaped[$this->buffer['i']]) + && $this->_escaped[$this->buffer['i']] != '') + { + $temp = $this->_escaped[$this->buffer['i']]; + } else { + $temp = ''; + } + $this->buffer['i']++; + return $this->buffer['escapeChar'] . $temp; + } + + private function _internalEscape($string) { + return preg_replace($this->ESCAPE, '', $string); + } +} + +function minify_js($js){ + $packer = new JavaScriptPacker($js, 'Normal', true, false); + return $packer->pack(); +} +?> From b7173df7caea6a04c467daa8fb1d8c8ff2f37cf5 Mon Sep 17 00:00:00 2001 From: Narimm Date: Sat, 30 Nov 2013 08:47:19 +1000 Subject: [PATCH 04/11] Changed structure to make packaging better --- .htaccess => htaccess.txt.tx | 2 +- smartoptimizer/index.php | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) rename .htaccess => htaccess.txt.tx (94%) diff --git a/.htaccess b/htaccess.txt.tx similarity index 94% rename from .htaccess rename to htaccess.txt.tx index fe505fb..56ecb47 100644 --- a/.htaccess +++ b/htaccess.txt.tx @@ -1,7 +1,7 @@ ExpiresActive On - ExpiresDefault "access plus 10 years" + ExpiresDefault "access plus 1 years" diff --git a/smartoptimizer/index.php b/smartoptimizer/index.php index 7923824..fd1734b 100644 --- a/smartoptimizer/index.php +++ b/smartoptimizer/index.php @@ -111,14 +111,14 @@ function filesmtime() { return $filesmtime; } -@include('config.php'); +require 'config.php'; list($query) = explode('?', urldecode($_SERVER['QUERY_STRING'])); if(isset($settings['groups']) && substr($query, 0, 6) == 'group.'){ //we have a pre-defined group to include $group_name = str_replace('group.','',$query); - if(isset($settings['groups'][$group_name])) { + if(isset($settings['groups'][$group_name])){ $fileNames = $settings['groups'][$group_name]; $fileDir = ''; } @@ -134,9 +134,8 @@ function filesmtime() { if ($settings['concatenate']) { if(!is_array($fileNames)){ - $files = explode($settings['separator'], $fileNames); - } - else{ + $files = explode($settings['separator'], $fileNames); + } else { $files = $fileNames; } $settings['concatenate'] = count($files) > 1; @@ -196,7 +195,10 @@ function_exists('gzencode')); } else headerNoCache(); if ($generateContent) { - if ($settings['minify']) include('minifiers/'.$fileMinifier.'.php'); + if ($settings['minify']){ + include 'minifiers/'.$fileMinifier.'.php'; + + } $content = array(); foreach ($files as $file) (($content[] = @file_get_contents($file)) !== false) || debugExit("File not found ($file)."); $content = implode("\n", $content); @@ -214,5 +216,4 @@ function_exists('gzencode')); readfile($cachedFile); } } else headerExit('304 Not Modified'); - ?> \ No newline at end of file From a3beb32fadb32eb88e0d38d85fcdcc6ed1d96983 Mon Sep 17 00:00:00 2001 From: benjamincharlton Date: Sat, 30 Nov 2013 12:56:55 +1000 Subject: [PATCH 05/11] Still has minification grouping code in - need to test and debug this code. Code cleaned and some docs added. --- .gitignore | 2 + ...cess.txt.tx => htaccess-smartoptimizer.txt | 8 ++ smartoptimizer/config.php | 4 +- smartoptimizer/index.php | 91 +++++++++++++------ 4 files changed, 73 insertions(+), 32 deletions(-) create mode 100644 .gitignore rename htaccess.txt.tx => htaccess-smartoptimizer.txt (78%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e5aad7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/nbproject/private/ +/nbproject/ \ No newline at end of file diff --git a/htaccess.txt.tx b/htaccess-smartoptimizer.txt similarity index 78% rename from htaccess.txt.tx rename to htaccess-smartoptimizer.txt index 56ecb47..52efa20 100644 --- a/htaccess.txt.tx +++ b/htaccess-smartoptimizer.txt @@ -1,3 +1,8 @@ +## Copy the lower part of this file into your current .htaccess file or rename this file to +# .htaccess if you dont have have one yet. +####### +# Begin Smartoptimizer +# ExpiresActive On @@ -24,3 +29,6 @@ FileETag none +# +# End SmartOptimizer additions +###### \ No newline at end of file diff --git a/smartoptimizer/config.php b/smartoptimizer/config.php index a05043b..4ca69dd 100644 --- a/smartoptimizer/config.php +++ b/smartoptimizer/config.php @@ -1,7 +1,7 @@ "application/x-shockwave-flash", "ico" => "image/x-icon", ); +/**Processs a time in a string + * + * @param datetime $time + * @return string Date formatted + */ + +function gmdatestr($time = null) { + if (is_null($time)){ $time = time();} + return gmdate("D, d M Y H:i:s", $time) . " GMT"; +} +/**Adds a status header and then exits + * + * @param string $status + */ function headerExit($status) { header("HTTP/1.0 $status"); exit(); } -function headerNoCache() { +function headerNoCache() + { // already expired header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); @@ -76,8 +97,12 @@ function headerNoCache() { } function headerNeverExpire(){ - header("Expires: " . gmdatestr(time() + 315360000)); - header("Cache-Control: max-age=315360000"); + $exptime = time()+ 31557600; + $curtime = time(); + header("Expires: " . gmdatestr($exptime)); + header("Cache-Control: max-age=31557600"); + header("Cache-Control: public"); + header("Last-Modified: ". gmdatestr($curtime)); } function debugExit($msg){ @@ -93,19 +118,22 @@ function debugExit($msg){ echo "//\n"; exit(); } - -function gmdatestr($time = null) { - if (is_null($time)) $time = time(); - return gmdate("D, d M Y H:i:s", $time) . " GMT"; -} +/**Gets the input files modification time and compares it to the modification time of /smartoptimizer/index.php and config.php + * and returns the larges of the 3 (ie the most recent time) + * + * @global type $files + * @global type $fileType + * @staticvar type $filesmtime + * @return type + */ function filesmtime() { global $files, $fileMinifier; static $filesmtime; - if ($filesmtime) return $filesmtime; + if ($filesmtime){return $filesmtime;} $filesmtime = max(@filemtime("minifiers/$fileMinifier.php"), filemtime('index.php'), filemtime('config.php')); foreach ($files as $file) { - if (!file_exists($file)) debugExit("File not found ($file)."); + if (!file_exists($file)) {debugExit("File not found ($file).");} $filesmtime = max(filemtime($file), $filesmtime); } return $filesmtime; @@ -122,12 +150,12 @@ function filesmtime() { $fileNames = $settings['groups'][$group_name]; $fileDir = ''; } - else debugExit("Group ($group_name) not set. Please edit config."); + else {debugExit("Group ($group_name) not set. Please edit config.");} } else { if (preg_match('/^\/?(.+\/)?(.+)$/', $query, $matchResult)) { $fileNames = $matchResult[2]; $fileDir = $settings['baseDir'].$matchResult[1]; - } else debugExit("Invalid file name ($query)"); + } else {debugExit("Invalid file name ($query)");} } //if (strpos(realpath($fileDir), realpath($settings['baseDir'])) !== 0) debugExit("File is out of base directory."); @@ -139,34 +167,34 @@ function filesmtime() { $files = $fileNames; } $settings['concatenate'] = count($files) > 1; -} else $files = array($fileNames); +} else {$files = array($fileNames);} foreach ($files as $key => $file) { if (preg_match('/^[^\x00]+\.([a-z0-9]+)$/i', $file, $matchResult)) { $fileTypes[] = strtolower($matchResult[1]); - } else debugExit("Unsupported file ($file)"); + } else {debugExit("Unsupported file ($file)");} $files[$key] = $fileDir.$file; } if ($settings['concatenate']) { - if (count(array_unique($fileTypes)) > 1) debugExit("Files must be of the same type."); + if (count(array_unique($fileTypes)) > 1) {debugExit("Files must be of the same type.");} } $fileType = $fileTypes[0]; $fileMinifier = $settings[$fileType.'Minifier']; -if(!file_exists('minifiers/'.$fileMinifier.'.php')) debugExit($fileType.'Minifier not found. Please create "minifiers/'.$fileMinifier.'.php" or change minifier in config.php'); +if(!file_exists('minifiers/'.$fileMinifier.'.php')) {debugExit($fileType.'Minifier not found. Please create "minifiers/'.$fileMinifier.'.php" or change minifier in config.php');} -if (!isset($mimeTypes[$fileType])) debugExit("Unsupported file type ($fileType)"); +if (!isset($mimeTypes[$fileType])){ debugExit("Unsupported file type ($fileType)");} header("Content-Type: {$mimeTypes[$fileType]}; charset=".$settings['charSet']); $settings['gzip'] = ($settings['gzip'] && !in_array($fileType, $settings['gzipExceptions']) && - in_array('gzip', array_map('trim', explode(',' , @$_SERVER['HTTP_ACCEPT_ENCODING']))) && + in_array('gzip', array_map('trim', explode(',' , $_SERVER['HTTP_ACCEPT_ENCODING']))) && function_exists('gzencode')); -if ($settings['gzip']) header("Content-Encoding: gzip"); +if ($settings['gzip']){ header("Content-Encoding: gzip");} $settings['minify'] = $settings['minify'] && file_exists('minifiers/'.$fileMinifier.'.php'); $settings['embed'] = $settings['embed'] && $fileType == 'css' && (!preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT']) || preg_match('/msie 8|opera/i', $_SERVER['HTTP_USER_AGENT'])); @@ -180,9 +208,9 @@ function_exists('gzencode')); ($settings['serverCache'] && (!file_exists($cachedFile) || ($settings['serverCacheCheck'] && filesmtime() > filemtime($cachedFile))))); if ($settings['clientCache'] && $settings['clientCacheCheck']) { - if ($settings['serverCache'] && !$generateContent) $mtime = filemtime($cachedFile); - elseif ($settings['serverCache']) $mtime = time(); - else $mtime = filesmtime(); + if ($settings['serverCache'] && !$generateContent) {$mtime = filemtime($cachedFile);} +elseif ($settings['serverCache']) {$mtime = time();} + else {$mtime = filesmtime();} $mtimestr = gmdatestr($mtime); } @@ -192,7 +220,7 @@ function_exists('gzencode')); header("Cache-Control: must-revalidate"); } elseif ($settings['clientCache']) { headerNeverExpire(); - } else headerNoCache(); + } else { headerNoCache();} if ($generateContent) { if ($settings['minify']){ @@ -200,20 +228,23 @@ function_exists('gzencode')); } $content = array(); - foreach ($files as $file) (($content[] = @file_get_contents($file)) !== false) || debugExit("File not found ($file)."); + foreach ($files as $file){(($content[] = file_get_contents($file)) !== false) || debugExit("File not found ($file).");} $content = implode("\n", $content); - if ($settings['minify']) $content = call_user_func('minify_' . $fileType, $content); - if ($settings['gzip']) $content = gzencode($content, $settings['compressionLevel']); + if ($settings['minify']) {$content = call_user_func('minify_' . $fileType, $content);} + if ($settings['gzip']){ $content = gzencode($content, $settings['compressionLevel']);} if ($settings['serverCache']) { $handle = @fopen($cachedFile, 'w') or debugExit("Could not create cache file($cachedFile)."); fwrite($handle, $content); fclose($handle); } header('Content-Length: ' . strlen($content)); + header("Cache-Control: public"); + header("Last-Modified: ". gmdatestr(filesmtime())); echo $content; } else { header('Content-Length: ' . filesize($cachedFile)); + header("Cache-Control: public"); + header("Last-Modified: ". gmdatestr(filesmtime())); readfile($cachedFile); } -} else headerExit('304 Not Modified'); -?> \ No newline at end of file +} else {headerExit('304 Not Modified');} \ No newline at end of file From 003c28aaadba772d3bf1648b547e502bd145ddad Mon Sep 17 00:00:00 2001 From: Narimm Date: Sat, 30 Nov 2013 15:11:22 +1000 Subject: [PATCH 06/11] update ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e5aad7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/nbproject/private/ +/nbproject/ \ No newline at end of file From d1d953fd827801b5d8cae858b3699f73ffe1b0ae Mon Sep 17 00:00:00 2001 From: Narimm Date: Sun, 1 Dec 2013 13:39:18 +1000 Subject: [PATCH 07/11] removed "group" settings - complicated the code overly without adding anything really functional. filtered a few http_server requests to ensure xss vulns are not available. Signed-off-by:Narimm --- smartoptimizer/config.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/smartoptimizer/config.php b/smartoptimizer/config.php index 4ca69dd..dff4f69 100644 --- a/smartoptimizer/config.php +++ b/smartoptimizer/config.php @@ -4,7 +4,7 @@ **/ //base dir (a relative path to the base directory) -$settings['baseDir'] = ''; +$settings['baseDir'] = '../'; //Encoding of your js and css files. (utf-8 or iso-8859-1) $settings['charSet'] = 'utf-8'; @@ -58,18 +58,19 @@ $settings['clientCacheCheck'] = false; //Minifier to use when parsing js files. Add yours in /minifiers directory, and implement function minify_js($text_to_minify) +//We have 2 js minifiers - the original coded by farahdi(js) or Dean Edwards Packer(packer). $settings['jsMinifier'] = 'packer'; //Minifier to use when parsing css files. Add yours in /minifiers directory, and implement function minify_css($text_to_minify) $settings['cssMinifier'] = 'css'; //To use groups effectively, include your files with absolute paths. Define constants for easy access. -define('MY_JS_DIR', $_SERVER['DOCUMENT_ROOT'] . '/tkitt/js/'); -define('MY_CSS_DIR', $_SERVER['DOCUMENT_ROOT'] . '/tkitt/css/'); +//define('MY_JS_DIR', $_SERVER['DOCUMENT_ROOT'] . '/tkitt/js/'); +//define('MY_CSS_DIR', $_SERVER['DOCUMENT_ROOT'] . '/tkitt/css/'); //groups configuration. Call a group by using /path/to/smartoptimizer/?group.group_name. //Tip: If you use 'test.js' as your group name, you'll get a nifty file name like 'group.test.js' -$settings['groups'] = array( - 'test.js' => array(MY_JS_DIR.'test.js', MY_JS_DIR.'test2.js'), - 'test.css' => array(MY_JS_DIR.'style.css', MY_JS_DIR.'print.css') -); \ No newline at end of file +//$settings['groups'] = array( +// 'test.js' => array(MY_JS_DIR.'test.js', MY_JS_DIR.'test2.js'), +// 'test.css' => array(MY_JS_DIR.'style.css', MY_JS_DIR.'print.css') +//); \ No newline at end of file From 3d3791c09c0d2a49f44a525d998f6b2e8daab3b2 Mon Sep 17 00:00:00 2001 From: Narimm Date: Sun, 1 Dec 2013 20:51:20 +1000 Subject: [PATCH 08/11] removed "group" settings - complicated the code overly without adding anything really functional. filtered a few http_server requests to ensure xss vulns are not available. Signed-off-by:Narimm --- smartoptimizer/index.php | 100 +++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/smartoptimizer/index.php b/smartoptimizer/index.php index 3bcdd4c..aa854b9 100644 --- a/smartoptimizer/index.php +++ b/smartoptimizer/index.php @@ -75,7 +75,9 @@ function headerExit($status) { header("HTTP/1.0 $status"); exit(); } - +/** + * Adds Headers to a returning HTTP response that tells a server not to cache the file ever + **/ function headerNoCache() { // already expired @@ -95,6 +97,9 @@ function headerNoCache() //generate a unique Etag each time header('Etag: '.microtime()); } +/** + * Adds header to the response informing that the file never expires cache it forever. + */ function headerNeverExpire(){ $exptime = time()+ 31557600; @@ -104,34 +109,41 @@ function headerNeverExpire(){ header("Cache-Control: public"); header("Last-Modified: ". gmdatestr($curtime)); } - -function debugExit($msg){ - global $settings; - if (!$settings['debug']) { - headerExit('404 Not Found'); - } - headerNoCache(); - header('Content-Type: text/html; charset='.$settings['charSet']); - header("Content-Encoding: none"); - echo "//\n"; - exit(); +/** + * Adds Headers to a file pls echo a Error that smartoptimizer couldnt process the file + * If Debug is set true this will 404 the file else it will return the file with a Script header. + * + * @global array $settings + * @param string $msg The message to ruturn if Debug is false + */ +function debugExit($msg) { + global $settings; + if (!$settings['debug']) { + headerExit('404 Not Found'); + } + headerNoCache(); + header('Content-Type: text/html; charset=' . $settings['charSet']); + header("Content-Encoding: none"); + echo "//\n"; + exit(); } + /**Gets the input files modification time and compares it to the modification time of /smartoptimizer/index.php and config.php * and returns the larges of the 3 (ie the most recent time) * - * @global type $files - * @global type $fileType - * @staticvar type $filesmtime - * @return type - */ + * @global array $files + * @global string $fileType + * @staticvar datetime $filesmtime + * @return datetime + **/ function filesmtime() { global $files, $fileMinifier; static $filesmtime; if ($filesmtime){return $filesmtime;} - $filesmtime = max(@filemtime("minifiers/$fileMinifier.php"), filemtime('index.php'), filemtime('config.php')); + $filesmtime = max(filemtime("minifiers/$fileMinifier.php"), filemtime('index.php'), filemtime('config.php')); foreach ($files as $file) { if (!file_exists($file)) {debugExit("File not found ($file).");} $filesmtime = max(filemtime($file), $filesmtime); @@ -143,22 +155,24 @@ function filesmtime() { list($query) = explode('?', urldecode($_SERVER['QUERY_STRING'])); -if(isset($settings['groups']) && substr($query, 0, 6) == 'group.'){ - //we have a pre-defined group to include - $group_name = str_replace('group.','',$query); - if(isset($settings['groups'][$group_name])){ - $fileNames = $settings['groups'][$group_name]; - $fileDir = ''; - } - else {debugExit("Group ($group_name) not set. Please edit config.");} +//if(isset($settings['groups']) && substr($query, 0, 6) == 'group.'){ +// //we have a pre-defined group to include +// $group_name = str_replace('group.','',$query); +// if(isset($settings['groups'][$group_name])){ +// $fileNames = $settings['groups'][$group_name]; +// $fileDir = ''; +// } +// else {debugExit("Group ($group_name) not set. Please edit config.");} +//} else { +if (preg_match('/^\/?(.+\/)?(.+)$/', $query, $matchResult)) { + $fileNames = $matchResult[2]; + $fileDir = $settings['baseDir'] . $matchResult[1]; } else { - if (preg_match('/^\/?(.+\/)?(.+)$/', $query, $matchResult)) { - $fileNames = $matchResult[2]; - $fileDir = $settings['baseDir'].$matchResult[1]; - } else {debugExit("Invalid file name ($query)");} -} - -//if (strpos(realpath($fileDir), realpath($settings['baseDir'])) !== 0) debugExit("File is out of base directory."); + debugExit("Invalid file name ($query)"); +} +//} +//check the file exists and is relative to the base directory. +if (strpos(realpath($fileDir), realpath($settings['baseDir'])) !== 0) {debugExit("File is out of base directory.");} if ($settings['concatenate']) { if(!is_array($fileNames)){ @@ -180,24 +194,26 @@ function filesmtime() { if ($settings['concatenate']) { if (count(array_unique($fileTypes)) > 1) {debugExit("Files must be of the same type.");} } - +//check we have a minifier $fileType = $fileTypes[0]; $fileMinifier = $settings[$fileType.'Minifier']; if(!file_exists('minifiers/'.$fileMinifier.'.php')) {debugExit($fileType.'Minifier not found. Please create "minifiers/'.$fileMinifier.'.php" or change minifier in config.php');} - +//check the file meets our filetypes list or if (!isset($mimeTypes[$fileType])){ debugExit("Unsupported file type ($fileType)");} header("Content-Type: {$mimeTypes[$fileType]}; charset=".$settings['charSet']); - +// lets check and see if the client accepts compression and change our variable if it doesnt also check the filetype to ensure we want to compress. $settings['gzip'] = ($settings['gzip'] && !in_array($fileType, $settings['gzipExceptions']) && - in_array('gzip', array_map('trim', explode(',' , $_SERVER['HTTP_ACCEPT_ENCODING']))) && + in_array('gzip', array_map('trim', explode(',' , htmlspecialchars($_SERVER['HTTP_ACCEPT_ENCODING'], ENT_QUOTES)))) && function_exists('gzencode')); - +// ok client likes compression - lets tell it we are sending a compressed file. if ($settings['gzip']){ header("Content-Encoding: gzip");} - +//check we have a minifier $settings['minify'] = $settings['minify'] && file_exists('minifiers/'.$fileMinifier.'.php'); -$settings['embed'] = $settings['embed'] && $fileType == 'css' && (!preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT']) || preg_match('/msie 8|opera/i', $_SERVER['HTTP_USER_AGENT'])); +//if its css and we have an opera browser embed the css +$settings['embed'] = $settings['embed'] && $fileType == 'css' && (!preg_match('/msie/i', htmlspecialchars($_SERVER['HTTP_USER_AGENT'])) || preg_match('/msie 8|opera/i', htmlspecialchars($_SERVER['HTTP_USER_AGENT']))); +//check if we want to call the cache. $settings['serverCache'] = $settings['serverCache'] && ($settings['minify'] || $settings['gzip'] || $settings['concatenate'] || $settings['embed']); if ($settings['serverCache']) { From 288341a68eca85178b0679e3b4e86915ebcf17cf Mon Sep 17 00:00:00 2001 From: Narimm Date: Mon, 2 Dec 2013 00:37:19 +1000 Subject: [PATCH 09/11] Added file size check to the gzip checks it will no longer gzip files under 5kb and inflate them Fixes issue #2 Added yukele's fix for css files not existing Added Ghosts fix for Vary: Accept-encoding header Signed-off-by:Narimm --- README | 5 +++-- smartoptimizer/index.php | 19 ++++++++----------- smartoptimizer/minifiers/css.php | 9 ++++++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README b/README index fde1158..a7beb38 100644 --- a/README +++ b/README @@ -1,6 +1,7 @@ -SmartOptimizer v1.8 +SmartOptimizer v1.8.1 alpha ------------------------ -Author: Ali Farhadi (http://farhadi.ir/) +Auther: Ben Charlton (https://github.com/Narimm) +@Depreciated Original Author: Ali Farhadi (http://farhadi.ir/) Released under the terms of the GNU Public License. See the GPL for details (http://www.gnu.org/licenses/gpl.html). diff --git a/smartoptimizer/index.php b/smartoptimizer/index.php index aa854b9..43f1399 100644 --- a/smartoptimizer/index.php +++ b/smartoptimizer/index.php @@ -101,14 +101,15 @@ function headerNoCache() * Adds header to the response informing that the file never expires cache it forever. */ -function headerNeverExpire(){ - $exptime = time()+ 31557600; - $curtime = time(); - header("Expires: " . gmdatestr($exptime)); - header("Cache-Control: max-age=31557600"); - header("Cache-Control: public"); - header("Last-Modified: ". gmdatestr($curtime)); +function headerNeverExpire() { + $exptime = time() + 31557600; + $curtime = time(); + header("Expires: " . gmdatestr($exptime)); + header("Cache-Control: public, max-age=31557600"); + header("Last-Modified: " . gmdatestr($curtime)); + header("Vary: Accept-Encoding"); } + /** * Adds Headers to a file pls echo a Error that smartoptimizer couldnt process the file * If Debug is set true this will 404 the file else it will return the file with a Script header. @@ -254,13 +255,9 @@ function_exists('gzencode')); fclose($handle); } header('Content-Length: ' . strlen($content)); - header("Cache-Control: public"); - header("Last-Modified: ". gmdatestr(filesmtime())); echo $content; } else { header('Content-Length: ' . filesize($cachedFile)); - header("Cache-Control: public"); - header("Last-Modified: ". gmdatestr(filesmtime())); readfile($cachedFile); } } else {headerExit('304 Not Modified');} \ No newline at end of file diff --git a/smartoptimizer/minifiers/css.php b/smartoptimizer/minifiers/css.php index 0a71b78..533dc98 100644 --- a/smartoptimizer/minifiers/css.php +++ b/smartoptimizer/minifiers/css.php @@ -14,9 +14,12 @@ function convertUrl($url, $count) if (preg_match('@^[^/]+:@', $url)) return $url; $fileType = substr(strrchr($url, '.'), 1); - if (isset($mimeTypes[$fileType])) $mimeType = $mimeTypes[$fileType]; - elseif (function_exists('mime_content_type')) $mimeType = mime_content_type($url); - else $mimeType = null; + if (isset($mimeTypes[$fileType])) + $mimeType = $mimeTypes[$fileType]; + elseif (function_exists('mime_content_type') && file_exists($fileDir.$url)) + $mimeType = mime_content_type($fileDir.$url); + else + $mimeType = null; if (!$settings['embed'] || !file_exists($fileDir.$url) || From b260569390e1f40db377563954ef4e028852fd83 Mon Sep 17 00:00:00 2001 From: Narimm Date: Mon, 2 Dec 2013 01:03:43 +1000 Subject: [PATCH 10/11] Added a distribution package updated readme Signed-off-by:Narimm --- README | 12 ++++++++---- distributions/SmartOptimizer.zip | Bin 0 -> 30884 bytes 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 distributions/SmartOptimizer.zip diff --git a/README b/README index a7beb38..0e72325 100644 --- a/README +++ b/README @@ -40,9 +40,11 @@ Installation Instructions ------------------------ 1. Upload smartoptimizer folder to your website. 2. "smartoptimizer/cache" folder should be writable (in most cases 777 permission is needed). -3. Upload .htaccess file on the folder that smartoptimizer folder is placed, if there is no another htaccess file currently. - Otherwise, Copy content of SmartOptimizer htaccess file and paste it inside your current htaccess at the beginning of the file. -4. It's ready. Enjoy it. +3. Upload htaccess-smartoptimizer.txt file on the folder that smartoptimizer folder is placed, if there is no another .htaccess file currently rename it to .htaccess + Otherwise, Copy content of htaccess-smartoptimizer.txt and paste it inside your current htaccess at the beginning of the file. +4. Access your site as normal to check everything works +5 ../Smartoptimizer/config.php has settings you can tweak and change. + Bug reports @@ -51,4 +53,6 @@ SmartOptimizer is in beta stage and needs a large scale testing specially for it So any feedback is greatly appreciated. Use the issue tracker at github for bug reports: -http://github.com/farhadi/SmartOptimizer/issues \ No newline at end of file +https://github.com/Narimm/SmartOptimizer/issues +Please ensure your reports include the site you are working on and any errors reported - +this program is not intended for live production sites as it is only in Beta and needs more testing. diff --git a/distributions/SmartOptimizer.zip b/distributions/SmartOptimizer.zip new file mode 100644 index 0000000000000000000000000000000000000000..dc95cbe7919e26d9c0f358bcc57e3db949056b6b GIT binary patch literal 30884 zcmZ^~V~nUlyS3T2ZQI6f+qP}nwr#t2+qP}nw%xPelR4*PX1=N9N$yluRjuSsuBU#~ zl9vJoK>+{&fB?8?@DVCEA1)`uQR02D4H%NrCAR>uQV09^Pd~b|&?V*py7XXsu zpBJ@$Wx=8++;~hM{=$<~J?ss6rzzo1E=|bEP z&^#qsQmYIpmKOs{o2_J6MoXJ0doKZ28;afSkuzZfP_=~=W4(Pl$>TcL-oLsPUDZl8 zd%9DAolJto2XWSC`Ia!6Qe^q|F;I#MLV|7c3g~~p<^1FL%`j~R{Z+(Kd`^Y`giX#V zLaPM=q!rSY_i1D233Fh!!KOf!tdTN)Od$1O+<3ByEK+1Z)x7PKb)Z-oC=p|i!aB4$ zz=siwvha|^9oKN1PMZIm`E!>h^&c4vsp28m@r&dr+#@-SId7;62hn4JR1)m$c7b;u zb>FPbd646!B4P$s2?wMiJJ-gr!8HbK1aS)Pu~(PH>u45<*D;N(g*C(^z+LlP_$&I- zAj6Cc<)t%+fnl*csYd)6POx0dtyXAT*;A#-XbMzL-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qe+GHtu3m7NaEBgS{CGbpBCYj!u{Eaq(5oul7c&m`K3<)tE zz9%DAT_Ey&pC#+BsUo=~_9#l-p1*wFvUyg_b7H7_Tjr# z$+m%dc!ZpbZ9!6#9rx#enJSFw#ssJf;8awW)81?$N-hxZ^J3?BkI$}C8$RQ%1G(@T zSi3sOMmPdkX`%Br_`^#;ex~5V;H!P$cvabO;8fg@Z<`OQOjFfSj(U6h$m5qlL zpwomNwMV}qpKgXPTCP6Qt$;!Jf&RAxF3CO~aQ^io`q$?l$6dnw*H^$FLdaojiqW_8 zDd69BXT-(n=g0M*uK#&3-k+{XKQg?2izolXF?oN&o}%&cqAsR@f7=i*+<#sF3H#?! zZhykIJ~Z_Ib+Fr?j)5^<|Mjo`r~T9MKV|rTI`(G!Ez1AX?*V@dR>|cQ@c-`jKPgdv z`$hUF_!+K$$UOf96p#E}0>3TF=f4B_^N;^iz4{yQSIxft6Y$?!);~$CF@JmhP55p9 zP5Mt7)!(GQLJ8#lM<{%v3eSPF~{G*%vQ@i#js+9j9rT5=Twm(T>RO&GWAEe(c z;-94dl#}_J^jAG`$^L`%?^Me_QF_ Date: Mon, 2 Dec 2013 01:05:16 +1000 Subject: [PATCH 11/11] spelling --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 0e72325..09eaace 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SmartOptimizer v1.8.1 alpha ------------------------ -Auther: Ben Charlton (https://github.com/Narimm) +Author: Ben Charlton (https://github.com/Narimm) @Depreciated Original Author: Ali Farhadi (http://farhadi.ir/) Released under the terms of the GNU Public License. See the GPL for details (http://www.gnu.org/licenses/gpl.html).