1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 00:28:34 +02:00

Compress CSS

This commit is contained in:
Jakub Vrana
2012-09-06 22:20:44 -07:00
parent 415f500f10
commit caa9f490af
4 changed files with 40 additions and 40 deletions

View File

@@ -78,44 +78,6 @@ function switch_lang() {
echo "</div>\n</form>\n";
}
// used in compiled version
function lzw_decompress($binary) {
// convert binary string to codes
$dictionary_count = 256;
$bits = 8; // ceil(log($dictionary_count, 2))
$codes = array();
$rest = 0;
$rest_length = 0;
for ($i=0; $i < strlen($binary); $i++) {
$rest = ($rest << 8) + ord($binary[$i]);
$rest_length += 8;
if ($rest_length >= $bits) {
$rest_length -= $bits;
$codes[] = $rest >> $rest_length;
$rest &= (1 << $rest_length) - 1;
$dictionary_count++;
if ($dictionary_count >> $bits) {
$bits++;
}
}
}
// decompression
$dictionary = range("\0", "\xFF");
$return = "";
foreach ($codes as $i => $code) {
$element = $dictionary[$code];
if (!isset($element)) {
$element = $word . $word[0];
}
$return .= $element;
if ($i) {
$dictionary[] = $word . $element[0];
}
$word = $element;
}
return $return;
}
if (isset($_POST["lang"]) && $_SESSION["token"] == $_POST["token"]) { // $token and $error not yet available
cookie("adminer_lang", $_POST["lang"]);
$_SESSION["lang"] = $_POST["lang"]; // cookies may be disabled