'min_backoff' => 1,
'current_backoff' => 1,
'max_backoff' => 32,
- 'cache' => null);
+ 'cache' => false,
+ 'cachettl' => 3600);
/**
* List of hosts we try to establish a connection to.
* schema object. */
$key = 'Horde_Ldap_Schema_' . md5(serialize(array($this->_config['hostspec'], $this->_config['port'], $dn)));
if (!$this->_schema && $this->_config['cache']) {
- $this->_schema = $this->_config['cache']->get($key);
+ $schema = $this->_config['cache']->get($key, $this->_config['cachettl']);
+ if ($schema) {
+ $this->_schema = @unserialize($schema);
+ }
}
/* Fetch schema, if not tried before and no cached version available.
/* If schema caching is active, advise the cache to store the
* schema. */
if ($this->_config['cache']) {
- $this->_config['cache']->set($key, $this->_schema);
+ $this->_config['cache']->set($key, serialize($this->_schema), $this->_config['cachettl']);
}
}