* * https://gist.github.com/manastungare/2625128#file-css-compress-php */ /* Add your CSS files to this array (THESE ARE ONLY EXAMPLES) */ $request = basename($_SERVER["REQUEST_URI"]); if (strpos($request, "nocturnal.js") || strpos($request, "core.js")) {} $request = isset($_GET["js"]) ? strtolower(htmlspecialchars($_GET["js"])) : false; $files = array( "mn" => "main", "ac" => "activity", "an" => "aeon", "ay" => "anomaly", "ct" => "contact", "eo" => "echo", "ln" => "lumin", "pm" => "prism", "sc" => "myth", ); if (strpos($request, "|")) { $codes = explode("|", $request); } else { $codes = array('an', 'ct', 'ay', 'ac', 'ln', 'sc'); } $codes[] = "mn"; $codes = array_unique($codes); $files = ["myth", "main"]; /** * Ideally, you wouldn't need to change any code beyond this point. */ $buffer = ""; foreach ($files as $file) { $content = file_get_contents("js/$file.js"); $needle = '//////////////////////////////////////////////////////////////////////////////80'; $pos = strrpos($content, $needle) + 80; // Spilt licmse block from code $block = substr($content, 0, $pos); $content = substr($content, $pos); // Remove comments $content = preg_replace('/(?:(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:(?