HELP!!!! anybody who knows php here?

Federico Voges fvoges
Mon May 17 11:39:07 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 20 Oct 2002 12:58:35 -0400, dep wrote:

>
>| Just checked jpcache.v2.0.0b2.tar.gz and you have the option to
>| turn gzip off (jpcache-config.php, line 31). That should turn gzip
>| off.
>|
>| Are you using this version?
>
>no, because it writes its cachefiles to mysql, and the whole purpose 
>is to relieve the pressure on the mysql machine; jean-pierre doesn't 
>have writing to file working on jpccache2 yet. so i am "using" 1.1.1, 
>which also allows gzip to be turned off (in jpcache.inc, which is the 
>version one uses for caching to file). problem is, even when i turn 
>it off, it stays on.
>
>i need to find a statement which says "under no circumstance use gzip. 
>just don't. in any way, shape, or form. if apache wants to use 
>mod_gzip, that's its business. but i want the cachefiles stored 
>uncompressed and no, i'm not kidding." there is no such command in 
>php that i can find, and while i've managed to hack about 100 lines 
>out of jpcache that thought would have solved the problem, it *still* 
>gzips the cachefiles. grrr.


Ok, then open jpcache.inc. 

Go to line 496:
        if ($USE_GZIP) 
        {
            $gzcontent = gzcompress($contents, 9);
        } 
        else 
        {
            $gzcontent = $contents;
        }

And replace with:

        $gzcontent = $contents;

and go to line 536 (543 before modification):
            // Are we gzipping ?
            if ($USE_GZIP) 
            {
                $ENCODING = getEncoding(); 
                if ($ENCODING) 
                { 
                    // compressed output: set header
                    header("Content-Encoding: $ENCODING");
                    $ret =  "\x1f\x8b\x08\x00\x00\x00\x00\x00";
                    $ret .= substr($gzcontents, 0, strlen($gzcontents)
- - 4);
                    $ret .= pack('V',$crc32);
                    $ret .= pack('V',$size);
                } 
                else 
                {
                    // Darn, we need to uncompress :(
                    $ret = gzuncompress($gzcontents);
                }
            } 
            else 
            {
                $ret=$gzcontents;
            }

and replace with:

            $ret=$gzcontents;

That should strip and gzip code from jpcache :)


Federico Voges
Socio gerente

Intrasoft
Malabia 2137 14 A
(1425) Buenos Aires
Argentina

Te/Fax: 54-11-4833-5182
e-mail: fvoges at intrasoft.com.ar
Web: http://www.intrasoft.com.ar

PGP Public Key Fingerprint: A536 4595 EB6F D197  FBC1 5C3A 145C 2516

-----BEGIN PGP SIGNATURE-----
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies.

iQA/AwUBPbMS+hRcJRaVKt4XEQKwXgCfesPqE8odziUi5tpoVIFpJQjHA98An1g9
l//r1bfaYGMSqn+oQerh+jt6
=dP6s
-----END PGP SIGNATURE-----




More information about the Linux-users mailing list