Lines Matching +full:select +full:- +full:user -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

31         $this->cache =& $cache_revinfo;
32 if (!isset($this->cache[$id])) {
33 $this->cache[$id] = [];
36 $this->id = $id;
37 $this->setChunkSize($chunk_size);
63 return $rev == $this->currentRevision();
74 return $rev === $this->lastRevision();
90 if (!isset($this->currentRevision)) {
92 $this->getCurrentRevisionInfo();
94 return $this->currentRevision;
104 $revs = $this->getRevisions(-1, 1);
118 $info['mode'] = $this->getMode();
119 $this->cache[$this->id][$info['date']] ??= $info;
136 * - date: unix timestamp
137 * - ip: IPv4 address (127.0.0.1)
138 * - type: log line type
139 * - id: page id
140 * - user: user name
141 * - sum: edit summary (or action reason)
142 * - extra: extra data (varies by line type)
143 * - sizechange: change of filesize
145 * - mode: page or media
156 if (!isset($this->currentRevision) && $retrieveCurrentRevInfo) {
157 $this->getCurrentRevisionInfo();
161 if (isset($this->cache[$this->id][$rev])) {
162 return $this->cache[$this->id][$rev];
166 [$fp, $lines] = $this->readloglines($rev);
174 $this->parseAndCacheLogLine($line);
177 return $this->cache[$this->id][$rev] ?? false;
209 $logfile = $this->getChangelogFilename();
220 $fileLastMod = $this->getFilename();
221 if (file_exists($fileLastMod) && $this->isLastRevision(filemtime($fileLastMod))) {
227 if (filesize($logfile) < $this->chunk_size || $this->chunk_size == 0) {
243 $finger = max($tail - $this->chunk_size, 0);
245 $nl = $this->getNewlinepointer($fp, $finger);
249 $finger = max($finger - $this->chunk_size, 0);
257 $read_size = max($tail - $finger, 0); // found chunk size
260 $tmp = @fread($fp, max(min($this->chunk_size, $read_size - $got), 0));
279 $finger = max($tail - $this->chunk_size, 0);
286 $num = max(min(count($lines) - $first, $num), 0);
288 $lines = array_slice($lines, max(count($lines) - $first - $num, 0), $num);
290 $lines = array_slice($lines, 0, max(count($lines) - $first, 0));
292 $lines = array_slice($lines, max(count($lines) - $num, 0));
296 for ($i = count($lines) - 1; $i >= 0; $i--) {
297 $info = $this->parseAndCacheLogLine($lines[$i]);
307 * Get the nth revision left or right-hand side for a specific page id and revision (timestamp)
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);
350 $start = $count - 1;
351 $step = -1;
354 $info = $this->parseAndCacheLogLine($lines[$i]);
356 //look for revs older/earlier then reference $rev and select $direction-th one
366 //true when $rev is found, but not the wanted follow-up.
372 [$lines, $head, $tail] = $this->readAdjacentChunk($fp, $head, $tail, $direction);
407 $rev2 = $this->currentRevision();
410 [$revs2, $allRevs, $fp, $lines, $head, $tail] = $this->retrieveRevisionsAround($rev2, $max);
418 [$revs1, , , , , ] = $this->retrieveRevisionsAround($rev1, $max);
425 for ($i = count($lines) - 1; $i >= 0; $i--) {
426 $info = $this->parseAndCacheLogLine($lines[$i]);
437 [$lines, $head, $tail] = $this->readAdjacentChunk($fp, $head, $tail, -1);
443 $revs1 = array_slice($revs1, max($index - (int) ($max / 2), 0), $max);
458 $fileLastMod = $this->getFilename();
459 //requested date_at(timestamp) younger or equal then modified_time($this->id) => load current
462 } elseif ($rev = $this->getRelativeRevision($date_at + 1, -1)) {
481 * - $requestedRevs: array of with $max revision timestamps
482 * - $revs: all parsed revision timestamps
483 * - $fp: file pointer only defined for chuck reading, needs closing.
484 * - $lines: non-parsed changelog lines before the parsed revisions
485 * - $head: position of first read changelog line
486 * - $lastTail: position of end of last read changelog line
496 [$fp, $lines, $startHead, $startTail, $eof] = $this->readloglines($rev);
504 $info = $this->parseAndCacheLogLine($line);
521 [$lines, $head, $tail] = $this->readAdjacentChunk($fp, $head, $tail, 1);
528 count($revs) && !$this->isCurrentRevision($revs[count($revs) - 1])
530 $revs[] = $this->currentRevision;
545 [$lines, $head, $tail] = $this->readAdjacentChunk($fp, $head, $tail, -1);
547 for ($i = count($lines) - 1; $i >= 0; $i--) {
548 $info = $this->parseAndCacheLogLine($lines[$i]);
553 if ($beforeCount > max((int) ($max / 2), $max - $afterCount)) {
559 //keep only non-parsed lines
565 $requestedRevs = array_slice($revs, -$max, $max);
586 * - date: revision identifier (timestamp or last revision +1)
587 * - ip: IPv4 address (127.0.0.1)
588 * - type: log line type
589 * - id: id of page or media
590 * - user: user name
591 * - sum: edit summary (or action reason)
592 * - extra: extra data (varies by line type)
593 * - sizechange: change of filesize
594 * - timestamp: unix timestamp or false (key set only for external edit occurred)
596 * - mode: page or media
604 if (isset($this->currentRevision)) {
605 return $this->getRevisionInfo($this->currentRevision);
609 $fileLastMod = $this->getFilename();
611 $lastRev = $this->lastRevision(); // false when no changelog
614 $this->currentRevision = false;
617 $this->currentRevision = $lastRev;
618 return $this->getRevisionInfo($lastRev);
623 $revInfo = $this->getRevisionInfo($lastRev, false);
625 $this->currentRevision = $lastRev;
631 'date' => max($lastRev + 1, time() - 1), // 1 sec before now or new page save
634 'id' => $this->id,
635 'user' => '',
636 'sum' => $lang['deleted'] . ' - ' . $lang['external_edit'] . ' (' . $lang['unknowndate'] . ')',
638 'sizechange' => -io_getSizeFile($this->getFilename($lastRev)),
640 'mode' => $this->getMode()
646 $this->getRevisionInfo($lastRev, false)['type'] == DOKU_CHANGE_TYPE_DELETE
648 $filesize_new = filesize($this->getFilename());
649 $filesize_old = $isJustCreated ? 0 : io_getSizeFile($this->getFilename($lastRev));
650 $sizechange = $filesize_new - $filesize_old;
654 $sum = $lang['created'] . ' - ' . $lang['external_edit'];
661 $details = 'File revision: ' . $fileRev . ' ' . dformat($fileRev, "%Y-%m-%d %H:%M:%S") . "\n"
662 . 'Last revision: ' . $lastRev . ' ' . dformat($lastRev, "%Y-%m-%d %H:%M:%S");
663 Logger::error($msg, $details, $this->getFilename());
673 'id' => $this->id,
674 'user' => '',
679 'mode' => $this->getMode()
684 $this->currentRevision = $revInfo['date'];
685 $this->cache[$this->id][$this->currentRevision] = $revInfo;
686 return $this->getRevisionInfo($this->currentRevision);
690 * Mechanism to trace no-actual external current revision
695 if ($rev > $this->lastRevision()) {
696 $rev = $this->currentRevision();