Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated to use Minify library for CSS

  • Loading branch information...
commit bed755c9a566fb9befbe1fccc25e3de7cc6bc3ed 1 parent e97fed0
Steven Mathias authored
Showing with 16 additions and 10 deletions.
  1. +3 −0  .gitmodules
  2. +12 −10 concatenate-static-files.php
  3. +1 −0  minify
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "minify"]
+ path = minify
+ url = https://github.com/mrclay/minify
View
22 concatenate-static-files.php
@@ -660,16 +660,18 @@ public static function buildConcatenatedStyleFile() {
if (!$file === false) {
// We have a valid file pointer.
- // Minify the contents
- $style_file_src = preg_replace( '#\s{2,}#', ' ', $style_file_src );
- $style_file_src = preg_replace( '#/\*.*?\*/#s', '', $style_file_src );
- $style_file_src = preg_replace( '/;[\s]+/', ';', $style_file_src );
- $style_file_src = preg_replace( '/:[\s]+/', ':', $style_file_src );
- $style_file_src = preg_replace( '/[\s]*{[\s]*/', '{', $style_file_src );
- $style_file_src = preg_replace( '/,[\s]+/', ',', $style_file_src );
- $style_file_src = preg_replace( '/[\s]*}[\s]*/', '}', $style_file_src );
- $style_file_src = str_replace( ';}', '}', $style_file_src );
- $style_file_src = trim( $style_file_src );
+ // Minify the contents using Minify library
+ include dirname(__file__).'/minify/min/lib/Minify/CSS.php';
+ $style_file_src = Minify_CSS::minify($style_file_src);
+ //$style_file_src = preg_replace( '#\s{2,}#', ' ', $style_file_src );
+ //$style_file_src = preg_replace( '#/\*.*?\*/#s', '', $style_file_src );
+ //$style_file_src = preg_replace( '/;[\s]+/', ';', $style_file_src );
+ //$style_file_src = preg_replace( '/:[\s]+/', ':', $style_file_src );
+ //$style_file_src = preg_replace( '/[\s]*{[\s]*/', '{', $style_file_src );
+ //$style_file_src = preg_replace( '/,[\s]+/', ',', $style_file_src );
+ //$style_file_src = preg_replace( '/[\s]*}[\s]*/', '}', $style_file_src );
+ //$style_file_src = str_replace( ';}', '}', $style_file_src );
+ //$style_file_src = trim( $style_file_src );*/
// Write the file and close it.
fwrite($file, $style_file_header.$style_file_src);
1  minify
@@ -0,0 +1 @@
+Subproject commit 8fdf3db5645be5b98a9100a394e2cfa75e28f39f
Please sign in to comment.
Something went wrong with that request. Please try again.