ZF-12449: OutputCache caches boolean result of buffering NOT a string
Description
As a result OutputCache puts in cache file boolean result of buffering.
public function end()
{
$key = array_pop($this->keyStack);
if ($key === null) {
throw new Exception\RuntimeException('Output cache not started');
}
$output = ob_end_flush(); // boolean
if ($output === false) {
throw new Exception\RuntimeException('Output buffering not active');
}
return $this->getOptions()->getStorage()->setItem($key, $output);
}
Please use {color:green}ob_get_flush(){color} instead {color:red}ob_end_flush(){color}, which returns result of buffering as a string.
Comments
Posted by Rob Allen (rob) on 2012-11-06T21:21:52.000+0000
I can't actually find this code!
Posted by Frank Brückner (frosch) on 2012-11-06T21:25:18.000+0000
It is code from version 2: {{Zend\Cache\Pattern\OutputCache}}!
Look at: https://github.com/zendframework/zf2/…
Posted by Rob Allen (rob) on 2012-11-06T21:27:39.000+0000
Doh!
Thanks Frank :)
Posted by Rob Allen (rob) on 2012-11-06T21:28:42.000+0000
This is a ZF2 issue, which is addresses here: https://github.com/zendframework/zf2/pull/2877