[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> changelog.php (summary)

Changelog handling functions

Author: Andreas Gohr
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 372 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 6 functions

  parseChangelogLine()
  addLogEntry()
  addMediaLogEntry()
  getRecents()
  getRecentsSince()
  _handleRecentLogLine()

Functions
Functions that are not part of a class:

parseChangelogLine($line)   X-Ref
parses a changelog line into it's components

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

addLogEntry($date,$id,$type = DOKU_CHANGE_TYPE_EDIT,$summary = '',$extra = '',$flags = null,$sizechange = null)   X-Ref
Adds an entry to the changelog and saves the metadata for the page

Note: timestamp of the change might not be unique especially after very quick
repeated edits (e.g. change checkbox via do plugin)

author: Andreas Gohr <andi@splitbrain.org>
author: Esther Brunner <wikidesign@gmail.com>
author: Ben Coburn <btcoburn@silicodon.net>
param: int    $date      Timestamp of the change
param: String $id        Name of the affected page
param: String $type      Type of the change see DOKU_CHANGE_TYPE_*
param: String $summary   Summary of the change
param: mixed  $extra     In case of a revert the revision (timestamp) of the reverted page
param: array  $flags     Additional flags in a key value array.
param: null|int $sizechange Change of filesize

addMediaLogEntry($date,$id,$type = DOKU_CHANGE_TYPE_EDIT,$summary = '',$extra = '',$flags = null,$sizechange = null)   X-Ref
Adds an entry to the media changelog

author: Michael Hamann <michael@content-space.de>
author: Andreas Gohr <andi@splitbrain.org>
author: Esther Brunner <wikidesign@gmail.com>
author: Ben Coburn <btcoburn@silicodon.net>
param: int    $date      Timestamp of the change
param: String $id        Name of the affected page
param: String $type      Type of the change see DOKU_CHANGE_TYPE_*
param: String $summary   Summary of the change
param: mixed  $extra     In case of a revert the revision (timestamp) of the reverted page
param: array  $flags     Additional flags in a key value array.
param: null|int $sizechange Change of filesize

getRecents($first, $num, $ns = '', $flags = 0)   X-Ref
returns an array of recently changed files using the changelog

The following constants can be used to control which changes are
included. Add them together as needed.

RECENTS_SKIP_DELETED   - don't include deleted pages
RECENTS_SKIP_MINORS    - don't include minor changes
RECENTS_ONLY_CREATION  - only include new created pages and media
RECENTS_SKIP_SUBSPACES - don't include subspaces
RECENTS_MEDIA_CHANGES  - return media changes instead of page changes
RECENTS_MEDIA_PAGES_MIXED  - return both media changes and page changes

return: array recently changed files
author: Ben Coburn <btcoburn@silicodon.net>
author: Kate Arzamastseva <pshns@ukr.net>
param: int    $first   number of first entry returned (for paginating
param: int    $num     return $num entries
param: string $ns      restrict to given namespace
param: int    $flags   see above

getRecentsSince($from, $to = null, $ns = '', $flags = 0)   X-Ref
returns an array of files changed since a given time using the
changelog

The following constants can be used to control which changes are
included. Add them together as needed.

RECENTS_SKIP_DELETED   - don't include deleted pages
RECENTS_SKIP_MINORS    - don't include minor changes
RECENTS_ONLY_CREATION  - only include new created pages and media
RECENTS_SKIP_SUBSPACES - don't include subspaces
RECENTS_MEDIA_CHANGES  - return media changes instead of page changes

return: array of files
author: Michael Hamann <michael@content-space.de>
author: Ben Coburn <btcoburn@silicodon.net>
param: int    $from    date of the oldest entry to return
param: int    $to      date of the newest entry to return (for pagination, optional)
param: string $ns      restrict to given namespace (optional)
param: int    $flags   see above (optional)

_handleRecentLogLine($line, $ns, $flags, &$seen)   X-Ref
Internal function used by getRecents
Parse a line and checks whether it should be included

don't call directly

return: array|bool    false or array with info about a change
author: Andreas Gohr <andi@splitbrain.org>
author: Ben Coburn <btcoburn@silicodon.net>
param: string $line   changelog line
param: string $ns     restrict to given namespace
param: int    $flags  flags to control which changes are included
param: array  $seen   listing of seen pages
see: getRecents()