Lines Matching defs:rev

43      * @param string|int $rev empty string or revision timestamp
46 abstract protected function getFilename($rev = '');
58 * @param int $rev timestamp of current page
59 * @return bool true if $rev is current revision, otherwise false
61 public function isCurrentRevision($rev)
63 return $rev == $this->currentRevision();
69 * @param int $rev revision timestamp
70 * @return bool true if $rev is last revision, otherwise false
72 public function isLastRevision($rev = null)
74 return $rev === $this->lastRevision();
132 * @param int $rev revision timestamp
150 public function getRevisionInfo($rev, $retrieveCurrentRevInfo = true)
152 $rev = max(0, $rev);
153 if (!$rev) return false;
161 if (isset($this->cache[$this->id][$rev])) {
162 return $this->cache[$this->id][$rev];
166 [$fp, $lines] = $this->readloglines($rev);
177 return $this->cache[$this->id][$rev] ?? false;
310 * reference revision $rev is read and sometimes a next chunk.
315 * @param int $rev revision timestamp used as start date
317 * @param int $direction give position of returned revision with respect to $rev;
323 public function getRelativeRevision($rev, $direction)
325 $rev = max($rev, 0);
328 //no direction given or last rev, so no follow-up
329 if (!$direction || ($direction > 0 && $this->isCurrentRevision($rev))) {
334 [$fp, $lines, $head, $tail, $eof] = $this->readloglines($rev);
337 // look for revisions later/earlier than $rev, when founded count till the wanted revision is reached
356 //look for revs older/earlier then reference $rev and select $direction-th one
357 if (($direction > 0 && $info['date'] > $rev) || ($direction < 0 && $info['date'] < $rev)) {
366 //true when $rev is found, but not the wanted follow-up.
368 && ($info['date'] == $rev || ($revCounter > 0 && !$relativeRev))
401 $rev = $rev2;
403 $rev1 = $rev;
462 } elseif ($rev = $this->getRelativeRevision($date_at + 1, -1)) {
464 return $rev;
471 * Collect the $max revisions near to the timestamp $rev
473 * Ideally, half of retrieved timestamps are older than $rev, another half are newer.
474 * The returned array $requestedRevs may not contain the reference timestamp $rev
477 * @param int $rev revision timestamp
489 protected function retrieveRevisionsAround($rev, $max)
496 [$fp, $lines, $startHead, $startTail, $eof] = $this->readloglines($rev);
507 if ($info['date'] >= $rev) {
508 //count revs after reference $rev
514 //enough revs after reference $rev?
535 //given timestamp $rev is newer than the most recent line in chunk
552 //enough revs before reference $rev?
691 * @param int $rev
693 public function traceCurrentRevision($rev)
695 if ($rev > $this->lastRevision()) {
696 $rev = $this->currentRevision();
698 return $rev;