Skip to content

Undefined variable $value #6304

Open
Open

Description

@da411d

if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key))

Activity

  1. jamieburchell commented on Oct 17, 2024

    @jamieburchell
    Contributor

    Maybe @exussum12 knows

    I can't figure out what this is supposed to be doing as the code it replaces returned the unserialized value in that case.

  2. exussum12 commented on Oct 17, 2024

    @exussum12
    Contributor

    Looks like it was refactored

                    $value = $this->_redis->get($key);
    
    		if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key))
    		{
    			return unserialize($value);
    		}
    

    Was the original. It was there for backwards compatibility between versions. There used to be a key in redis which stored all other keys, that made redis slow for large caches.

    The current code (without any testing) looks like it will have the same issue of scaling for large caches.

    Happy to remove the value (as its never used) though would check it scales with 1m cache entries for example

  3. jamieburchell commented on Oct 17, 2024

    @jamieburchell
    Contributor

    I think how it was before this merge makes most sense, but I don't have any experience with this code and don't use Redis myself.

  4. exussum12 commented on Oct 17, 2024

    @exussum12
    Contributor

    The PR which was merged

    https://github.com/bcit-ci/CodeIgniter/pull/5752/files

    The context around where that PR came from

    #5739

    The context of the PR, I think all of the code which interacts with _ci_redis_serialized can be removed - it looks like BC between versions and will have been long enough now to now have an issue with removing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions