Welcome Guest, Not a member yet? Register   Sign In
mp_cache
#11

[eluser]JanDoToDo[/eluser]
I have errors turned on yep. And Well I tried it with all the settings.. Strange, Any way to find out whats going on? There is no default expiration set in the config file. Ill try setting it really high and see what happens
#12

[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 Wink.

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.




Theme © iAndrew 2016 - Forum software by © MyBB