[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/deferred/ -> LinksUpdate.php (summary)

Updater for link tracking tables after a page edit. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

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

Defines 2 classes

LinksUpdate:: (42 methods):
  __construct()
  doUpdate()
  doIncrementalUpdate()
  queueRecursiveJobs()
  queueRecursiveJobsForTable()
  invalidateCategories()
  updateCategoryCounts()
  invalidateImageDescriptions()
  incrTableUpdate()
  getLinkInsertions()
  getTemplateInsertions()
  getImageInsertions()
  getExternalInsertions()
  getCategoryInsertions()
  getInterlangInsertions()
  getPropertyInsertions()
  getPagePropRowData()
  getPropertySortKeyValue()
  getInterwikiInsertions()
  getLinkDeletions()
  getTemplateDeletions()
  getImageDeletions()
  getExternalDeletions()
  getCategoryDeletions()
  getInterlangDeletions()
  getPropertyDeletions()
  getInterwikiDeletions()
  getExistingLinks()
  getExistingTemplates()
  getExistingImages()
  getExistingExternals()
  getExistingCategories()
  getExistingInterlangs()
  getExistingInterwikis()
  getExistingProperties()
  getTitle()
  getParserOutput()
  getImages()
  invalidateProperties()
  getAddedLinks()
  getRemovedLinks()
  updateLinksTimestamp()

LinksDeletionUpdate:: (3 methods):
  __construct()
  doUpdate()
  updateCategoryCounts()


Class: LinksUpdate  - X-Ref

See docs/deferred.txt

__construct( $title, $parserOutput, $recursive = true )   X-Ref
Constructor

param: Title $title Title of the page we're updating
param: ParserOutput $parserOutput Output from a full parse of this page
param: bool $recursive Queue jobs for recursive updates?

doUpdate()   X-Ref
Update link tables with outgoing links from an updated article


doIncrementalUpdate()   X-Ref
No description

queueRecursiveJobs()   X-Ref
Queue recursive jobs for this page

Which means do LinksUpdate on all pages that include the current page,
using the job queue.

queueRecursiveJobsForTable( Title $title, $table )   X-Ref
Queue a RefreshLinks job for any table.

param: Title $title Title to do job for
param: string $table Table to use (e.g. 'templatelinks')

invalidateCategories( $cats )   X-Ref

param: array $cats

updateCategoryCounts( $added, $deleted )   X-Ref
Update all the appropriate counts in the category table.

param: array $added Associative array of category name => sort key
param: array $deleted Associative array of category name => sort key

invalidateImageDescriptions( $images )   X-Ref

param: array $images

incrTableUpdate( $table, $prefix, $deletions, $insertions )   X-Ref
Update a table by doing a delete query then an insert query

param: string $table Table name
param: string $prefix Field name prefix
param: array $deletions
param: array $insertions Rows to insert

getLinkInsertions( $existing = array()   X-Ref
Get an array of pagelinks insertions for passing to the DB
Skips the titles specified by the 2-D array $existing

param: array $existing
return: array

getTemplateInsertions( $existing = array()   X-Ref
Get an array of template insertions. Like getLinkInsertions()

param: array $existing
return: array

getImageInsertions( $existing = array()   X-Ref
Get an array of image insertions
Skips the names specified in $existing

param: array $existing
return: array

getExternalInsertions( $existing = array()   X-Ref
Get an array of externallinks insertions. Skips the names specified in $existing

param: array $existing
return: array

getCategoryInsertions( $existing = array()   X-Ref
Get an array of category insertions

param: array $existing Mapping existing category names to sort keys. If both
return: array

getInterlangInsertions( $existing = array()   X-Ref
Get an array of interlanguage link insertions

param: array $existing Mapping existing language codes to titles
return: array

getPropertyInsertions( $existing = array()   X-Ref
Get an array of page property insertions

param: array $existing
return: array

getPagePropRowData( $prop )   X-Ref
Returns an associative array to be used for inserting a row into
the page_props table. Besides the given property name, this will
include the page id from $this->mId and any property value from
$this->mProperties.

The array returned will include the pp_sortkey field if this
is present in the database (as indicated by $wgPagePropsHaveSortkey).
The sortkey value is currently determined by getPropertySortKeyValue().

param: string $prop The name of the property.
return: array

getPropertySortKeyValue( $value )   X-Ref
Determines the sort key for the given property value.
This will return $value if it is a float or int,
1 or resp. 0 if it is a bool, and null otherwise.

param: mixed $value
return: float|null

getInterwikiInsertions( $existing = array()   X-Ref
Get an array of interwiki insertions for passing to the DB
Skips the titles specified by the 2-D array $existing

param: array $existing
return: array

getLinkDeletions( $existing )   X-Ref
Given an array of existing links, returns those links which are not in $this
and thus should be deleted.

param: array $existing
return: array

getTemplateDeletions( $existing )   X-Ref
Given an array of existing templates, returns those templates which are not in $this
and thus should be deleted.

param: array $existing
return: array

getImageDeletions( $existing )   X-Ref
Given an array of existing images, returns those images which are not in $this
and thus should be deleted.

param: array $existing
return: array

getExternalDeletions( $existing )   X-Ref
Given an array of existing external links, returns those links which are not
in $this and thus should be deleted.

param: array $existing
return: array

getCategoryDeletions( $existing )   X-Ref
Given an array of existing categories, returns those categories which are not in $this
and thus should be deleted.

param: array $existing
return: array

getInterlangDeletions( $existing )   X-Ref
Given an array of existing interlanguage links, returns those links which are not
in $this and thus should be deleted.

param: array $existing
return: array

getPropertyDeletions( $existing )   X-Ref
Get array of properties which should be deleted.

param: array $existing
return: array

getInterwikiDeletions( $existing )   X-Ref
Given an array of existing interwiki links, returns those links which are not in $this
and thus should be deleted.

param: array $existing
return: array

getExistingLinks()   X-Ref
Get an array of existing links, as a 2-D array

return: array

getExistingTemplates()   X-Ref
Get an array of existing templates, as a 2-D array

return: array

getExistingImages()   X-Ref
Get an array of existing images, image names in the keys

return: array

getExistingExternals()   X-Ref
Get an array of existing external links, URLs in the keys

return: array

getExistingCategories()   X-Ref
Get an array of existing categories, with the name in the key and sort key in the value.

return: array

getExistingInterlangs()   X-Ref
Get an array of existing interlanguage links, with the language code in the key and the
title in the value.

return: array

getExistingInterwikis()   X-Ref
Get an array of existing inline interwiki links, as a 2-D array

return: array (prefix => array(dbkey => 1))

getExistingProperties()   X-Ref
Get an array of existing categories, with the name in the key and sort key in the value.

return: array Array of property names and values

getTitle()   X-Ref
Return the title object of the page being updated

return: Title

getParserOutput()   X-Ref
Returns parser output

return: ParserOutput

getImages()   X-Ref
Return the list of images used as generated by the parser

return: array

invalidateProperties( $changed )   X-Ref
Invalidate any necessary link lists related to page property changes

param: array $changed

getAddedLinks()   X-Ref
Fetch page links added by this LinksUpdate.  Only available after the update is complete.

return: null|array Array of Titles

getRemovedLinks()   X-Ref
Fetch page links removed by this LinksUpdate.  Only available after the update is complete.

return: null|array Array of Titles

updateLinksTimestamp()   X-Ref
Update links table freshness


Class: LinksDeletionUpdate  - X-Ref

Update object handling the cleanup of links tables after a page was deleted.

__construct( WikiPage $page )   X-Ref
Constructor

param: WikiPage $page Page we are updating

doUpdate()   X-Ref
Do some database updates after deletion


updateCategoryCounts( $added, $deleted )   X-Ref
Update all the appropriate counts in the category table.

param: array $added Associative array of category name => sort key
param: array $deleted Associative array of category name => sort key



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