From: Alan Date: Fri, 22 Oct 2021 04:54:50 +0000 (+0800) Subject: convert css compression to use csstidy X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=1feb190f013536de9fcd9f13fafe4f409bef63c9 convert css compression to use csstidy --- 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`;