[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ChangeLog/ -> ChangeLogTrait.php (summary)

Provides methods for handling of changelog

File Size: 269 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  parseLogLine()
  buildLogLine()
  hasRevisions()
  setChunkSize()
  readloglines()
  readChunk()
  getNewlinepointer()
  readAdjacentChunk()

Functions
Functions that are not part of a class:

parseLogLine($line)   X-Ref
Parses a changelog line into it's components

param: string $line changelog line
author: Ben Coburn <btcoburn@silicodon.net>
return: array|bool parsed line or false

buildLogLine(array &$info, $timestamp = null)   X-Ref
Build a changelog line from it's components

param: array $info Revision info structure
param: int $timestamp log line date (optional)
return: string changelog line

hasRevisions()   X-Ref
Checks if the ID has old revisions

return: boolean

setChunkSize($chunk_size)   X-Ref
Set chunk size for file reading
Chunk size zero let read whole file at once

param: int $chunk_size maximum block size read from file

readloglines($rev)   X-Ref
Returns lines from changelog.
If file larger than $chunk_size, only chunk is read that could contain $rev.

When reference timestamp $rev is outside time range of changelog, readloglines() will return
lines in first or last chunk, but they obviously does not contain $rev.

param: int $rev revision timestamp
return: array|false

readChunk($fp, $head, $tail)   X-Ref
Read chunk and return array with lines of given chunk.
Has no check if $head and $tail are really at a new line

param: resource $fp resource file pointer
param: int $head start point chunk
param: int $tail end point chunk
return: array lines read from chunk

getNewlinepointer($fp, $finger)   X-Ref
Set pointer to first new line after $finger and return its position

param: resource $fp file pointer
param: int $finger a pointer
return: int pointer

readAdjacentChunk($fp, $head, $tail, $direction)   X-Ref
Returns the next lines of the changelog  of the chunk before head or after tail

param: resource $fp file pointer
param: int $head position head of last chunk
param: int $tail position tail of last chunk
param: int $direction positive forward, negative backward
return: array with entries: