[eluser]Jelmer[/eluser]
What I do myself sometimes when trying to figure out what's wrong is to add is to add exit statements to check out if the value is what I expect it to be.
It goes wrong in the write() function so you could try exit statements at these points to figure out where the wrong value is set:
After this part (lines 207-216)
Code:
// Check if cache was passed with the function or uses this object
if ($contents !== NULL)
{
$this->reset();
$this->contents = $contents;
$this->filename = $filename;
if ($expires !== NULL)
$this->expires = time() + $expires;
$this->dependencies = $dependencies;
}
Add:
Code:
exit(serialize($this->expires));
That should output "N;" (serialized NULL) if it outputs something like "i:1265293769" than it's already wrong there. Just don't forget to remove it afterwards
.
Another part where it could go wrong is (lines 258-267):
Code:
// Add expires variable if its set...
if (! empty($this->expires) && $this->expires > time())
{
$this->contents['__mp_cache_expires'] = $this->expires;
}
// ...or add default expiration if its set
elseif (! empty($this->default_expires) && $this->expires !== 0)
{
$this->contents['__mp_cache_expires'] = $this->default_expires;
}
Try what happens when you chang it to:
Code:
// Add expires variable if its set...
if (! empty($this->expires) && $this->expires > time())
{
exit('normal expires: '.$this->expires);
$this->contents['__mp_cache_expires'] = $this->expires;
}
// ...or add default expiration if its set
elseif (! empty($this->default_expires) && $this->expires !== 0)
{
exit('default expires: '.$this->default_expires);
$this->contents['__mp_cache_expires'] = $this->default_expires;
}
That should show which sets the expiration when it shouldn't be set.