<commit_before><?php

chdir(__DIR__ . "/../root");
error_reporting(E_ALL);
date_default_timezone_set("UTC");

require_once __DIR__ . "/../general_config.php";
require_once __DIR__ . "/../vendor/autoload.php";

$output = __DIR__ . "/../root/css/all.min.css";
$source_map_path = __DIR__ . "/../root/css/all.min.css.map";
$css = "";

foreach (explode(":", UI_CSS_FILES) as $file) {
	$css .= file_get_contents("css/{$file}");
}

$bef = $css;
$autoprefixer = new Autoprefixer("last 2 versions");
$css = $autoprefixer->compile($css);

$len = strlen($css);

$compressor = new CSSmin();
$compressor->set_memory_limit('256M');
$css .= $compressor->run($css);

print "compress css: " . $len / strlen($css) . "\n";

$before = md5(@file_get_contents($output));
$after = md5($css);

if ($after !== $before) {
	file_put_contents($output, $css);
}

$time = filemtime($output);
$config = "<?php const CSS_VERSION = {$time};";

file_put_contents(__DIR__ . '/../gen/version_css.php', $config);<commit_msg>Remove stupid .<commit_after><?php

chdir(__DIR__ . "/../root");
error_reporting(E_ALL);
date_default_timezone_set("UTC");

require_once __DIR__ . "/../general_config.php";
require_once __DIR__ . "/../vendor/autoload.php";

$output = __DIR__ . "/../root/css/all.min.css";
$source_map_path = __DIR__ . "/../root/css/all.min.css.map";
$css = "";

foreach (explode(":", UI_CSS_FILES) as $file) {
	$css .= file_get_contents("css/{$file}");
}

$bef = $css;
$autoprefixer = new Autoprefixer("last 2 versions");
$css = $autoprefixer->compile($css);

$len = strlen($css);

$compressor = new CSSmin();
$compressor->set_memory_limit('256M');
$css = $compressor->run($css);

print "compress css: " . strlen($css) / $len . "\n";

$before = md5(@file_get_contents($output));
$after = md5($css);

if ($after !== $before) {
	file_put_contents($output, $css);
}

$time = filemtime($output);
$config = "<?php const CSS_VERSION = {$time};";

file_put_contents(__DIR__ . '/../gen/version_css.php', $config);
{'fraction_non_alphanumeric': 0.22683544303797468, 'fraction_numerical': 0.0060759493670886075, 'mean_word_length': 4.933933933933934, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1419161', 'n_tokens_mistral': 759, 'n_tokens_neox': 758, 'n_words': 135}