Git Product home page Git Product logo

Comments (7)

RobiNN1 avatar RobiNN1 commented on July 17, 2024

I know, currently it just shows a plain unformatted value. This is definitely something that needs to be improved.

from phpcacheadmin.

VIS89 avatar VIS89 commented on July 17, 2024

gzipkey.txt
Here's the key in txt format.
Thanks for a great job!

from phpcacheadmin.

VIS89 avatar VIS89 commented on July 17, 2024

Hey, sorry to reopen the task. Just tested it, here's the result.
image

from phpcacheadmin.

RobiNN1 avatar RobiNN1 commented on July 17, 2024

What the heck is this compression lol. I tried the standard gzcompress(), gzencode(), gzdeflate() and these work fine.

I need to check Magento source code. If this is from it.

from phpcacheadmin.

VIS89 avatar VIS89 commented on July 17, 2024

I can help you if you need more info, just let me know. You can write me here or email me.

from phpcacheadmin.

RobiNN1 avatar RobiNN1 commented on July 17, 2024

Got it, Magento uses this library https://github.com/colinmollenhour/Cm_Cache_Backend_Redis

And here is code for decoding https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/blob/master/Cm/Cache/Backend/Redis.php#L1315

It uses standard gzuncompress() as well but with prefix..

from phpcacheadmin.

RobiNN1 avatar RobiNN1 commented on July 17, 2024

Small update:

I don't want any system-specific codes in this app, so add this into 'encoding' => [] section in your config.php file

'gz_magento' => [
    'view' => static function (string $value): ?string {
        // https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/blob/master/Cm/Cache/Backend/Redis.php#L1306-L1323
        if (strpos($value, "gz:\x1f\x8b") === 0) {
            $value = substr($value, 5);
        }

        return @gzuncompress($value) !== false ? gzuncompress($value) : null;
    },
    'save' => static fn (string $value): string => "gz:\x1f\x8b".gzcompress($value),
],

The reason is simple, app now allows people to add their own encoding/decoding functions, so there's no reason to have it there by default. Also not everyone uses Magento.

from phpcacheadmin.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.