From 1feb190f013536de9fcd9f13fafe4f409bef63c9 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 22 Oct 2021 12:54:50 +0800 Subject: [PATCH] convert css compression to use csstidy --- JsCompile.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/JsCompile.php b/JsCompile.php index a5b91590..6fcd1ee6 100644 --- a/JsCompile.php +++ b/JsCompile.php @@ -199,20 +199,19 @@ class Pman_Core_JsCompile extends Pman function packCssCore($files, $output) { - - $o = HTML_FlexyFramework::get()->Pman_Core; + + // csstidy + // cat x a b c | csstidy - --preserve_css=true --remove_bslash=false --silent=true --template=highest {out} + - if (empty($o['cssminify']) || !file_exists($o['cssminify'])) { - echo ''; - return false; - } require_once 'System.php'; - $seed= System::which('seed'); - $gjs = System::which('gjs'); + $csstidy= System::which('csstidy'); + $cat = System::which('cat'); - if (!$seed && !$gjs) { - echo ''; + + if (!$csstidy) { + echo ''; return false; } @@ -230,9 +229,9 @@ class Pman_Core_JsCompile extends Pman mkdir(dirname($output), 0755, true); } $eoutput = escapeshellarg($output); - $cmd = $seed ? - ("$seed {$o['cssminify']} $eoutput " . implode($ofiles, ' ')) : - ("$gjs {$o['cssminify']} -- -- $eoutput " . implode($ofiles, ' ')); + + $cmd = "$cat " . implode($ofiles, " ") . " | $csstidy - --preserve_css=true --remove_bslash=false --silent=true --template=highest $eoutput"; + //echo "
$cmd\n"; echo `$cmd`; exit;
         `$cmd`;
         
-- 
2.39.2