protected function parseTimeout($timeoutValue)
{
if (self::JCR_INFINITE == $timeoutValue) {
return null;
}
if (!preg_match('/Second\\-([\\d]+)/', $timeoutValue, $matches)) {
throw new RepositoryException("Unexpected response on lock from the backend, could not parse seconds out of '{$timeoutValue}'");
}
$time = $matches[1];
// keep this hack for jackrabbit 2.3.7 for now. it reported a bogous value for the timeout
if (self::JCR_INFINITE_LOCK_TIMEOUT == $time || self::JCR_INFINITE_LOCK_TIMEOUT - 1 == $time) {
// prevent glitches due to second boundary during request
return null;
}
return time() + $time;
}