[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/maintenance/ -> backupPrefetch.inc (summary)

Helper class for the --prefetch option of dumpTextPass.php Copyright © 2005 Brion Vibber <[email protected]> https://www.mediawiki.org/

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

Defines 1 class

BaseDump:: (9 methods):
  __construct()
  prefetch()
  debug()
  nextPage()
  nextRev()
  nextText()
  skipTo()
  nodeContents()
  close()


Class: BaseDump  - X-Ref

Readahead helper for making large MediaWiki data dumps;
reads in a previous XML dump to sequentially prefetch text
records already normalized and decompressed.

This can save load on the external database servers, hopefully.

Assumes that dumps will be recorded in the canonical order:
- ascending by page_id
- ascending by rev_id within each page
- text contents are immutable and should not change once
recorded, so the previous dump is a reliable source

__construct( $infile )   X-Ref
No description

prefetch( $page, $rev )   X-Ref
Attempts to fetch the text of a particular page revision
from the dump stream. May return null if the page is
unavailable.

param: int $page ID number of page to read
param: int $rev ID number of revision to read
return: string|null

debug( $str )   X-Ref
No description

nextPage()   X-Ref


nextRev()   X-Ref


nextText()   X-Ref

return: string

skipTo( $name, $parent = 'page' )   X-Ref

param: string $name
param: string $parent
return: bool|null

nodeContents()   X-Ref
Shouldn't something like this be built-in to XMLReader?
Fetches text contents of the current element, assuming
no sub-elements or such scary things.

return: string

close()   X-Ref

return: null



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1