/**
* TODO
*
* @param array $opts Options:
* - 'file': (string) The filename to process.
* REQUIRED for this driver.
* - 'range': (array) The patchsets to process.
* DEFAULT: None (all patchsets are processed).
* - 'timezone': (string) The current timezone.
*
* @return Horde_Vcs_Patchset Patchset object.
*/
public function getPatchset($opts = array())
{
$class = 'Horde_Vcs_Patchset_' . $this->_driver;
if (!is_array($opts)) {
$opts = array();
}
ksort($opts);
$cacheId = implode('|', array($class, $this->sourceroot, serialize($opts), $this->_cacheVersion));
if (!empty($this->_cache)) {
if (isset($opts['file']) && file_exists($opts['file'])) {
$ctime = time() - filemtime($opts['file']);
} else {
$ctime = 60;
}
if ($this->_cache->exists($cacheId, $ctime)) {
return unserialize($this->_cache->get($cacheId, $ctime));
}
}
$ob = new $class($this, $opts);
if (!empty($this->_cache)) {
$this->_cache->set($cacheId, serialize($ob));
}
return $ob;
}