function compileCss($version, $old_version, $images_version) { echo "COMPILING CSS\n"; $config = getZombieConfig(); $root = $config['zombie_root']; exec("rm -rf {$root}/web/build/css/" . $old_version); exec("mkdir -p {$root}/web/build/css/" . $version); $files = getCssFileLists(); foreach ($files as $file => $list) { $css = compileCssList($list, true, $version, $images_version); $out_file = $root . "/web/build/css/{$version}/{$file}.css"; echo "writing {$out_file}\n"; file_put_contents($out_file, $css); } echo "\n"; }
<?php require_once __DIR__ . '/../../zombie-core/util/dir.php'; require_once __DIR__ . '/../../zombie-core/util/compile/compile.php'; header("Content-type: text/css"); if (!isset($_GET['name'])) { header("Status: 404 Not Found"); exit; } else { $name = $_GET['name']; } $file_lists = getCssFileLists(); if (!isset($file_lists[$name])) { header("Status: 404 Not Found"); exit; } else { $output = compileCssList($file_lists[$name], isset($_REQUEST['min'])); echo $output; }