Skip to content

sfAPCCache seems to not be compatible with apcu #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
j0k3r opened this issue Mar 9, 2014 · 1 comment
Closed

sfAPCCache seems to not be compatible with apcu #48

j0k3r opened this issue Mar 9, 2014 · 1 comment
Assignees

Comments

@j0k3r
Copy link
Contributor

j0k3r commented Mar 9, 2014

APCu seems to not use the same way to store "key".
sfAPCCache->getCacheInfo():

  protected function getCacheInfo($key)
  {
    if (!$this->enabled)
    {
      return false;
    }

    $infos = apc_cache_info('user');

    if (is_array($infos['cache_list']))
    {
      foreach ($infos['cache_list'] as $info)
      {
        if ($this->getOption('prefix').$key == $info['info'])
        {
          return $info;
        }
      }
    }

    return null;
  }

Before this if if ($this->getOption('prefix').$key == $info['info']), I vardumped the $info array and here it is for APCu & APC.
With APCu:

array (size=9)
  'key' => string 'account:/localhost/all/main/index/__sf_cache_key/item_tags_8267' (length=63)
  'ttl' => int 86400
  'nhits' => float 0
  'mtime' => int 1394384708
  'ctime' => int 1394384708
  'dtime' => int 0
  'atime' => int 1394384708
  'ref_count' => int 0
  'mem_size' => int 1712

And this with APC:

array (size=9)
  'info' => string 'account:/localhost/all/main/index/__sf_cache_key/item_tags_8267' (length=63)
  'ttl' => int 86400
  'nhits' => float 0
  'mtime' => int 1394384708
  'ctime' => int 1394384708
  'dtime' => int 0
  'atime' => int 1394384708
  'ref_count' => int 0
  'mem_size' => int 1712

Spot the first key from the array ? info != key
Should we create a sfAPCuCache ? The problem will also appear in removePattern().

@mentalstring
Copy link
Contributor

I believe the key name is is actually a bug on APCu as seen at krakjoe/apcu#41. So I don't think a sfAPCuCache is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants