Property | Type | Description | |
---|---|---|---|
$cache | array | ||
$chunk_size | integer | ||
$id | string |
Method | Description | |
---|---|---|
__construct ( string $id, integer $chunk_size = 8192 ) | Constructor | |
getLastRevisionAt ( number $date_at ) : string | Return an existing revision for a specific date which is the current one or younger or equal then the date | |
getRelativeRevision ( integer $rev, integer $direction ) : boolean | integer | Get the nth revision left or right handside for a specific page id and revision (timestamp) | |
getRevisionInfo ( integer $rev ) : boolean | array | Get the changelog information for a specific page id and revision (timestamp) | |
getRevisions ( integer $first, integer $num ) : array | Return a list of page revisions numbers | |
getRevisionsAround ( integer $rev1, integer $rev2, integer $max = 50 ) : array | Returns revisions around rev1 and rev2 When available it returns $max entries for each revision | |
isCurrentRevision ( integer $rev ) : boolean | Check whether given revision is the current page | |
setChunkSize ( integer $chunk_size ) | Set chunk size for file reading Chunk size zero let read whole file at once |
Method | Description | |
---|---|---|
getChangelogFilename ( ) : string | Returns path to changelog | |
getFilename ( ) : string | Returns path to current page/media | |
getNewlinepointer ( resource $fp, integer $finger ) : integer | Set pointer to first new line after $finger and return its position | |
readAdjacentChunk ( resource $fp, integer $head, integer $tail, integer $direction ) : array | Returns the next lines of the changelog of the chunck before head or after tail | |
readChunk ( resource $fp, integer $head, integer $tail ) : array | Read chunk and return array with lines of given chunck. | |
readloglines ( integer $rev ) : array | false | Returns lines from changelog. | |
retrieveRevisionsAround ( integer $rev, integer $max ) : boolean | array | Collect the $max revisions near to the timestamp $rev |
public __construct ( string $id, integer $chunk_size = 8192 ) | ||
$id | string | page id |
$chunk_size | integer | maximum block size read from file |
abstract protected getChangelogFilename ( ) : string | ||
return | string | path to file |
abstract protected getFilename ( ) : string | ||
return | string | path to file |
public getLastRevisionAt ( number $date_at ) : string | ||
$date_at | number | timestamp |
return | string | revision ('' for current) |
protected getNewlinepointer ( resource $fp, integer $finger ) : integer | ||
$fp | resource | filepointer |
$finger | integer | a pointer |
return | integer | pointer |
public getRelativeRevision ( integer $rev, integer $direction ) : boolean | integer | ||
$rev | integer | revision timestamp used as startdate (doesn't need to be revisionnumber) |
$direction | integer | give position of returned revision with respect to $rev; positive=next, negative=prev |
return | boolean | integer | timestamp of the requested revision otherwise false |
public getRevisionInfo ( integer $rev ) : boolean | array | ||
$rev | integer | revision timestamp |
return | boolean | array | false or array with entries: - date: unix timestamp - ip: IPv4 address (127.0.0.1) - type: log line type - id: page id - user: user name - sum: edit summary (or action reason) - extra: extra data (varies by line type) |
public getRevisionsAround ( integer $rev1, integer $rev2, integer $max = 50 ) : array | ||
$rev1 | integer | oldest revision timestamp |
$rev2 | integer | newest revision timestamp (0 looks up last revision) |
$max | integer | maximum number of revisions returned |
return | array | with two arrays with revisions surrounding rev1 respectively rev2 |
public isCurrentRevision ( integer $rev ) : boolean | ||
$rev | integer | timestamp of current page |
return | boolean | true if $rev is current revision, otherwise false |
protected readAdjacentChunk ( resource $fp, integer $head, integer $tail, integer $direction ) : array | ||
$fp | resource | filepointer |
$head | integer | position head of last chunk |
$tail | integer | position tail of last chunk |
$direction | integer | positive forward, negative backward |
return | array | with entries: - $lines: changelog lines of readed chunk - $head: head of chunk - $tail: tail of chunk |
protected readloglines ( integer $rev ) : array | false | ||
$rev | integer | revision timestamp |
return | array | false | if success returns array(fp, array(changeloglines), $head, $tail, $eof) where fp only defined for chuck reading, needs closing. otherwise false |
protected retrieveRevisionsAround ( integer $rev, integer $max ) : boolean | array | ||
$rev | integer | revision timestamp |
$max | integer | maximum number of revisions to be returned |
return | boolean | array | return array with entries: - $requestedrevs: array of with $max revision timestamps - $revs: all parsed revision timestamps - $fp: filepointer only defined for chuck reading, needs closing. - $lines: non-parsed changelog lines before the parsed revisions - $head: position of first readed changelogline - $lasttail: position of end of last readed changelogline otherwise false |
public setChunkSize ( integer $chunk_size ) | ||
$chunk_size | integer | maximum block size read from file |