Skip to content
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

Fix infinite lifetime in Zend_Cache_Backend_TwoLevels class #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mahdy-nasr
Copy link

There is a bug in the zf1/library/Zend/Cache/Backend/TwoLevels.php class which is setting the lifetime for the fast cache _getFastLifetime function.

It always set the lifetime to infinite (to null which is casted to 0) regardless the $lifetime parameter because of the default value of the $maxLifetime = null.

###The resposible condition part of the code as follow:

if ($maxLifetime >= 0 && $fastLifetime > $maxLifetime) {
            return $maxLifetime;
}

which will always evalute to true because of the default value of the $maxLifetime = null.

the issue faced while developing with memcached in Magento 2.2.5.

this is an bug in Zend framework 1 and it solved in early Zend framework 2
Links of the bug:

but I solved same as how it solved in ZF2 :

@magento-cicd2
Copy link

magento-cicd2 commented Aug 15, 2018

CLA assistant check
All committers have signed the CLA.

@mahdy-nasr
Copy link
Author

are there any changes or comments wanted?

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

Successfully merging this pull request may close these issues.

None yet

2 participants