View file inc/gzip2.php

File size: 1Kb
<?php 
// Файл взят из скрипта WAP_MOTOR 16.2_beta
// Автор VANTUZ http://pizdec.ru
if ($config_gzip == "1") {
    echo'[Gzip <font color="green">ON</font>]';
} else {
    echo'[Gzip <font color="red">OFF</font>]';
} 
if ($config_gzip == "1") {
    // echo'<br><font color="#FF0000">[Gzip ON]</font>';
    $Contents = ob_get_contents();
    $gzib_file = strlen($Contents);

    if ($support_deflate) {
        $gzib_file_out = strlen(gzdeflate($Contents, 9));
    } else {
        if ($support_gzip) {
            $gzib_file_out = strlen(gzencode($Contents, 9));
        } else {
            if ($support_x_gzip) {
                $gzib_file_out = strlen(gzcompress($Contents, 9));
            } else {
                $gzib_file_out = strlen($Contents);
            } 
        } 
    } 

    $gzib_pro = round(100 - (100 / ($gzib_file / $gzib_file_out)), 1);
    if ($gzib_pro > 0 && $gzib_pro < 100) {
        echo ' ' . $gzib_pro . '%';
    } 
} 
echo'<br>';

?>