diff --git a/builder/index.php b/builder/index.php index 9cb8c1a6..d4ea38c1 100644 --- a/builder/index.php +++ b/builder/index.php @@ -1,4 +1,4 @@ -encode(); $he->sendAll(); - } else { // echo status "0" or "1" header('Content-Type: text/plain'); diff --git a/builder/test.php b/builder/test.php index 88e8da05..c139ec60 100644 --- a/builder/test.php +++ b/builder/test.php @@ -37,7 +37,7 @@ echo "
\$_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] is set. " . "You may need to set \$min_documentRoot to this in config.php
"; } - + } -//*/ \ No newline at end of file +//*/ diff --git a/config-test.php b/config-test.php index 7524a3d1..8b903a54 100644 --- a/config-test.php +++ b/config-test.php @@ -4,7 +4,6 @@ * * To test config options, place them in this file and add "&test" to your Minify URL. * Note that if this is on a public server, anyone can execute your test. - * + * * @package Minify */ - diff --git a/config.php b/config.php index 02f01ca5..3eb084d8 100644 --- a/config.php +++ b/config.php @@ -2,7 +2,7 @@ /** * Configuration for "min", the default application built with the Minify * library - * + * * @package Minify */ @@ -47,7 +47,7 @@ * /min/f=file1.js send the cookie minDebug=file1.js * You can manually enable debugging by appending "&debug" to a URI. * E.g. /min/?f=script1.js,script2.js&debug - * + * * In 'debug' mode, Minify combines files with no minification and adds comments * to indicate line #s of the original files. */ @@ -73,11 +73,11 @@ /** * Leave an empty string to use PHP's $_SERVER['DOCUMENT_ROOT']. * - * On some servers, this value may be misconfigured or missing. If so, set this + * On some servers, this value may be misconfigured or missing. If so, set this * to your full document root path with no trailing slash. * E.g. '/home/accountname/public_html' or 'c:\\xampp\\htdocs' * - * If /min/ is directly inside your document root, just uncomment the + * If /min/ is directly inside your document root, just uncomment the * second line. The third line might work on some Apache servers. */ $min_documentRoot = ''; @@ -87,7 +87,7 @@ /** - * Cache file locking. Set to false if filesystem is NFS. On at least one + * Cache file locking. Set to false if filesystem is NFS. On at least one * NFS system flock-ing attempts stalled PHP for 30 seconds! */ $min_cacheFileLocking = true; @@ -96,9 +96,9 @@ /** * Combining multiple CSS files can place @import declarations after rules, which * is invalid. Minify will attempt to detect when this happens and place a - * warning comment at the top of the CSS output. To resolve this you can either - * move the @imports within your CSS files, or enable this option, which will - * move all @imports to the top of the output. Note that moving @imports could + * warning comment at the top of the CSS output. To resolve this you can either + * move the @imports within your CSS files, or enable this option, which will + * move all @imports to the top of the output. Note that moving @imports could * affect CSS values (which is why this option is disabled by default). */ $min_serveOptions['bubbleCssImports'] = false; @@ -134,8 +134,8 @@ * particular directories below DOCUMENT_ROOT, set this here. * You will still need to include the directory in the * f or b GET parameters. - * - * // = shortcut for DOCUMENT_ROOT + * + * // = shortcut for DOCUMENT_ROOT */ //$min_serveOptions['minApp']['allowDirs'] = array('//js', '//css'); @@ -149,7 +149,7 @@ /** * By default, Minify will not minify files with names containing .min or -min * before the extension. E.g. myFile.min.js will not be processed by JSMin - * + * * To minify all files, set this option to null. You could also specify your * own pattern that is matched against the filename. */ @@ -160,8 +160,8 @@ * If you minify CSS files stored in symlink-ed directories, the URI rewriting * algorithm can fail. To prevent this, provide an array of link paths to * target paths, where the link paths are within the document root. - * - * Because paths need to be normalized for this to work, use "//" to substitute + * + * Because paths need to be normalized for this to work, use "//" to substitute * the doc root in the link paths (the array keys). E.g.: *
* array('//symlink' => '/real/target/path') // unix
@@ -173,17 +173,17 @@
/**
* If you upload files from Windows to a non-Windows server, Windows may report
- * incorrect mtimes for the files. This may cause Minify to keep serving stale
+ * incorrect mtimes for the files. This may cause Minify to keep serving stale
* cache files when source file changes are made too frequently (e.g. more than
* once an hour).
- *
- * Immediately after modifying and uploading a file, use the touch command to
+ *
+ * Immediately after modifying and uploading a file, use the touch command to
* update the mtime on the server. If the mtime jumps ahead by a number of hours,
- * set this variable to that number. If the mtime moves back, this should not be
+ * set this variable to that number. If the mtime moves back, this should not be
* needed.
*
- * In the Windows SFTP client WinSCP, there's an option that may fix this
- * issue without changing the variable below. Under login > environment,
+ * In the Windows SFTP client WinSCP, there's an option that may fix this
+ * issue without changing the variable below. Under login > environment,
* select the option "Adjust remote timestamp with DST".
* @link http://winscp.net/eng/docs/ui_login_environment#daylight_saving_time
*/
@@ -198,4 +198,3 @@
*/
//$min_factories['minify'] = ... a callable accepting a Minify\App object
//$min_factories['controller'] = ... a callable accepting a Minify\App object
-
diff --git a/index.php b/index.php
index 7b58bcc7..e3fea30c 100644
--- a/index.php
+++ b/index.php
@@ -1,9 +1,9 @@
options['quiet']) {
$this->errorExit($this->options['badRequestHeader'], self::URL_DEBUG);
} else {
- list(,$statusCode) = explode(' ', $this->options['badRequestHeader']);
+ list(, $statusCode) = explode(' ', $this->options['badRequestHeader']);
return array(
'success' => false,
@@ -470,7 +470,7 @@ public function combine($sources, $options = array())
public function errorExit($header, $url = '', $msgHtml = '')
{
$url = htmlspecialchars($url, ENT_QUOTES);
- list(,$h1) = explode(' ', $header, 2);
+ list(, $h1) = explode(' ', $header, 2);
$h1 = htmlspecialchars($h1);
// FastCGI environments require 3rd arg to header() to be set
list(, $code) = explode(' ', $header, 3);
@@ -593,7 +593,8 @@ protected function combineMinify()
! $source // yes, we ran out of sources
|| $type === self::TYPE_CSS // yes, to process CSS individually (avoiding PCRE bugs/limits)
|| $minifier !== $lastMinifier // yes, minifier changed
- || $options !== $lastOptions)) { // yes, options changed
+ || $options !== $lastOptions // yes, options changed
+ )) {
// minify previous sources with last settings
$imploded = implode($implodeSeparator, $groupToProcessTogether);
$groupToProcessTogether = array();
diff --git a/lib/Minify/App.php b/lib/Minify/App.php
index bc885b21..4ed15a60 100644
--- a/lib/Minify/App.php
+++ b/lib/Minify/App.php
@@ -82,8 +82,7 @@ public function __construct($dir)
$varDefined = get_defined_vars();
- $varNames = array_filter($varNames, function($name) use($varDefined)
- {
+ $varNames = array_filter($varNames, function ($name) use ($varDefined) {
return array_key_exists($name, $varDefined);
});
diff --git a/lib/Minify/CSSmin.php b/lib/Minify/CSSmin.php
index 753c5109..0003f735 100644
--- a/lib/Minify/CSSmin.php
+++ b/lib/Minify/CSSmin.php
@@ -73,16 +73,16 @@ public static function minify($css, $options = array())
}
if ($options['currentDir']) {
return Minify_CSS_UriRewriter::rewrite(
- $css
- ,$options['currentDir']
- ,$options['docRoot']
- ,$options['symlinks']
+ $css,
+ $options['currentDir'],
+ $options['docRoot'],
+ $options['symlinks']
);
}
return Minify_CSS_UriRewriter::prepend(
- $css
- ,$options['prependRelativePath']
+ $css,
+ $options['prependRelativePath']
);
}
}
diff --git a/lib/Minify/Cache/Null.php b/lib/Minify/Cache/Null.php
index 4f654a6c..165043ee 100644
--- a/lib/Minify/Cache/Null.php
+++ b/lib/Minify/Cache/Null.php
@@ -64,4 +64,4 @@ public function display($id)
public function fetch($id)
{
}
-}
\ No newline at end of file
+}
diff --git a/lib/Minify/Cache/WinCache.php b/lib/Minify/Cache/WinCache.php
index 46e285a7..3dd1c40f 100644
--- a/lib/Minify/Cache/WinCache.php
+++ b/lib/Minify/Cache/WinCache.php
@@ -136,4 +136,4 @@ private function _fetch($id)
return true;
}
-}
\ No newline at end of file
+}
diff --git a/lib/Minify/Controller/Files.php b/lib/Minify/Controller/Files.php
index 85a76d0e..7d517f4d 100644
--- a/lib/Minify/Controller/Files.php
+++ b/lib/Minify/Controller/Files.php
@@ -68,4 +68,3 @@ public function createConfiguration(array $options)
return new Minify_ServeConfiguration($options, $sources);
}
}
-
diff --git a/lib/Minify/Controller/Groups.php b/lib/Minify/Controller/Groups.php
index af8af336..d3813f2c 100644
--- a/lib/Minify/Controller/Groups.php
+++ b/lib/Minify/Controller/Groups.php
@@ -73,4 +73,3 @@ public function createConfiguration(array $options)
return parent::createConfiguration($options);
}
}
-
diff --git a/lib/Minify/Controller/Page.php b/lib/Minify/Controller/Page.php
index 7001fe0e..ca2778c9 100644
--- a/lib/Minify/Controller/Page.php
+++ b/lib/Minify/Controller/Page.php
@@ -66,4 +66,3 @@ public function createConfiguration(array $options)
return new Minify_ServeConfiguration($options, $sources, $selectionId);
}
}
-
diff --git a/lib/Minify/ControllerInterface.php b/lib/Minify/ControllerInterface.php
index 35b4de3f..1527ff6c 100644
--- a/lib/Minify/ControllerInterface.php
+++ b/lib/Minify/ControllerInterface.php
@@ -19,4 +19,4 @@ public function createConfiguration(array $options);
* @return Minify_Env
*/
public function getEnv();
-}
\ No newline at end of file
+}
diff --git a/lib/Minify/HTML.php b/lib/Minify/HTML.php
index 5dfb095d..ef98b386 100644
--- a/lib/Minify/HTML.php
+++ b/lib/Minify/HTML.php
@@ -99,32 +99,34 @@ public function process()
// replace SCRIPTs (and minify) with placeholders
$this->_html = preg_replace_callback(
- '/(\\s*){$ws2}"
: "{$ws1}{$openScript}{$js}{$ws2}"
);
diff --git a/lib/Minify/ImportProcessor.php b/lib/Minify/ImportProcessor.php
index 85d9ff51..f8ed4b45 100644
--- a/lib/Minify/ImportProcessor.php
+++ b/lib/Minify/ImportProcessor.php
@@ -66,7 +66,7 @@ private function _getContent($file, $is_imported = false)
$this->_currentDir = dirname($file);
// remove UTF-8 BOM if present
- if (pack("CCC",0xef,0xbb,0xbf) === substr($content, 0, 3)) {
+ if (pack("CCC", 0xef, 0xbb, 0xbf) === substr($content, 0, 3)) {
$content = substr($content, 3);
}
// ensure uniform EOLs
diff --git a/lib/Minify/JS/ClosureCompiler.php b/lib/Minify/JS/ClosureCompiler.php
index b8426220..19190351 100644
--- a/lib/Minify/JS/ClosureCompiler.php
+++ b/lib/Minify/JS/ClosureCompiler.php
@@ -195,13 +195,13 @@ protected function getResponse($postBody)
curl_close($ch);
} else {
throw new Minify_JS_ClosureCompiler_Exception(
- "Could not make HTTP request: allow_url_open is false and cURL not available"
+ "Could not make HTTP request: allow_url_open is false and cURL not available"
);
}
if (false === $contents) {
throw new Minify_JS_ClosureCompiler_Exception(
- "No HTTP response from server"
+ "No HTTP response from server"
);
}
diff --git a/lib/Minify/NailgunClosureCompiler.php b/lib/Minify/NailgunClosureCompiler.php
index bdc49da8..8ce45200 100644
--- a/lib/Minify/NailgunClosureCompiler.php
+++ b/lib/Minify/NailgunClosureCompiler.php
@@ -110,4 +110,4 @@ private function startServer()
$this->shell("$serverCommand /dev/null 2>/dev/null & sleep 10");
}
-}
\ No newline at end of file
+}
diff --git a/lib/Minify/Source/Factory.php b/lib/Minify/Source/Factory.php
index f36d1b25..3e6e378c 100644
--- a/lib/Minify/Source/Factory.php
+++ b/lib/Minify/Source/Factory.php
@@ -170,7 +170,7 @@ public function makeSource($spec)
if ($this->options['noMinPattern'] && preg_match($this->options['noMinPattern'], $basename)) {
if (preg_match('~\.(css|less)$~i', $basename)) {
$spec['minifyOptions']['compress'] = false;
- // we still want URI rewriting to work for CSS
+ // we still want URI rewriting to work for CSS
} else {
$spec['minifier'] = 'Minify::nullMinifier';
}
diff --git a/lib/Minify/YUICompressor.php b/lib/Minify/YUICompressor.php
index a45f5723..47723fc9 100644
--- a/lib/Minify/YUICompressor.php
+++ b/lib/Minify/YUICompressor.php
@@ -154,4 +154,3 @@ private static function _prepare()
}
}
}
-
diff --git a/lib/MrClay/Cli.php b/lib/MrClay/Cli.php
index e9ef3b3b..fc736abe 100644
--- a/lib/MrClay/Cli.php
+++ b/lib/MrClay/Cli.php
@@ -390,4 +390,3 @@ protected function addError($letter, $msg, $value = null)
$this->errors[$letter][] = sprintf($msg, $value);
}
}
-
diff --git a/min_extras/cli/rewrite-uris.php b/min_extras/cli/rewrite-uris.php
index 0ca560f1..08ca7c8e 100755
--- a/min_extras/cli/rewrite-uris.php
+++ b/min_extras/cli/rewrite-uris.php
@@ -27,7 +27,7 @@
$testRun = $cli->values['t'];
$docRoot = $cli->values['d'];
-$pathRewriter = function($css, $options) {
+$pathRewriter = function ($css, $options) {
return Minify_CSS_UriRewriter::rewrite($css, $options['currentDir'], $options['docRoot']);
};
@@ -54,9 +54,8 @@
if ($testRun) {
echo $combined;
echo Minify_CSS_UriRewriter::$debugText . "\n";
-} else {
+} else {
$fp = $cli->openOutput();
fwrite($fp, $combined);
$cli->closeOutput();
}
-
diff --git a/min_extras/config.php b/min_extras/config.php
index cb33edd1..c7143b62 100644
--- a/min_extras/config.php
+++ b/min_extras/config.php
@@ -4,6 +4,6 @@
require __DIR__ . '/../config.php';
-$minifyCachePath = isset($min_cachePath)
- ? $min_cachePath
+$minifyCachePath = isset($min_cachePath)
+ ? $min_cachePath
: '';
diff --git a/min_extras/tools/minifyTextarea.php b/min_extras/tools/minifyTextarea.php
index a5b5926e..64c04f80 100644
--- a/min_extras/tools/minifyTextarea.php
+++ b/min_extras/tools/minifyTextarea.php
@@ -13,7 +13,8 @@
$env = $app->env;
-function h($txt) {
+function h($txt)
+{
return htmlspecialchars($txt, ENT_QUOTES, 'UTF-8');
}
@@ -22,13 +23,12 @@ function h($txt) {
}
if ($env->post('method') === 'Minify and serve') {
-
$base = trim($env->post('base'));
if ($base) {
$textIn = preg_replace(
- '@(]*>)@i'
- ,'$1 '
- ,$textIn
+ '@(]*>)@i',
+ '$1 ',
+ $textIn
);
}
@@ -58,7 +58,6 @@ function h($txt) {
$tpl['classes'] = array('Minify_HTML', 'JSMin\\JSMin', 'Minify_CSS', 'Minify_Lines');
if (in_array($env->post('method'), $tpl['classes'])) {
-
$args = array($textIn);
if ($env->post('method') === 'Minify_HTML') {
$args[] = array(
@@ -88,7 +87,8 @@ function h($txt) {
* @param string $input
* @return string HTML
*/
-function getExceptionMsg(Exception $e, $input) {
+function getExceptionMsg(Exception $e, $input)
+{
$msg = "" . h($e->getMessage()) . "
";
if (0 === strpos(get_class($e), 'JSMin_Unterminated')
&& preg_match('~byte (\d+)~', $e->getMessage(), $m)) {
@@ -113,37 +113,35 @@ function getExceptionMsg(Exception $e, $input) {
*
* @param array $vars
*/
-function sendPage($vars) {
- header('Content-Type: text/html; charset=utf-8');
-?>
+function sendPage($vars)
+{
+ header('Content-Type: text/html; charset=utf-8'); ?>
minifyTextarea
Warning! Please do not place this application on a public site. This should be used only for testing.
Bytes in {$vars['inBytes']} (after line endings normalized to \\n
)
Bytes out {$vars['outBytes']} (reduced " . round(100 - (100 * $vars['outBytes'] / $vars['inBytes'])) . "%)
Time (s) " . round($vars['time'], 5) . "
";
-}
-?>
+ } ?>