Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Setting cache options problems #427

Closed
storeman opened this issue Sep 2, 2014 · 0 comments
Closed

Setting cache options problems #427

storeman opened this issue Sep 2, 2014 · 0 comments

Comments

@storeman
Copy link
Contributor

storeman commented Sep 2, 2014

In Zend_Cache the following code is used multiple times:

while (list($name, $value) = each($options)) {
   //....
}

This is a problem when the options are looped through earlier, the internal pointer is not 0 anymore. I had problems with this, I could not set the cache dir and took me some time to figure out what was happening.

As I see it, it could be solved in two ways:

  1. Calling reset before looping through the options
  2. Use foreach instead of while/each (I prefer this one)

This constuction is used multiple times through Zend_Cache. I replaced all using the second method. All tests passed succesfully.

Do I miss anything before I place a pull request?

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

No branches or pull requests

2 participants