From 370e83bb0dfd0c70de268c93bf07ad5ee0897192 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 15 Aug 2008 01:29:47 +0200 Subject: Update auf 1.13.0 --- docs/linkcache.txt | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'docs/linkcache.txt') diff --git a/docs/linkcache.txt b/docs/linkcache.txt index 3e9799c3..266f200d 100644 --- a/docs/linkcache.txt +++ b/docs/linkcache.txt @@ -1,18 +1,24 @@ linkcache.txt -The LinkCache class maintains a list of article titles and -the information about whether or not the article exists in -the database. This is used to mark up links when displaying -a page. If the same link appears more than once on any page, -then it only has to be looked up once. In most cases, link -lookups are done in batches with the LinkBatch class, or the -equivalent in Parser::replaceLinkHolders(), so the link -cache is mostly useful for short snippets of parsed text -(such as the site notice), and for links in the navigation -areas of the skin. +The LinkCache class maintains a list of article titles and the information about +whether or not the article exists in the database. This is used to mark up links +when displaying a page. If the same link appears more than once on any page, +then it only has to be looked up once. In most cases, link lookups are done in +batches with the LinkBatch class, or the equivalent in Parser::replaceLinkHolders(), +so the link cache is mostly useful for short snippets of parsed text (such as +the site notice), and for links in the navigation areas of the skin. -The link cache was formerly used to track links used in a -document for the purposes of updating the link tables. This -application is now deprecated. +The link cache was formerly used to track links used in a document for the +purposes of updating the link tables. This application is now deprecated. +To create a batch, you can use the following code: +$pages = array( 'Main Page', 'Project:Help', /* ... */ ); +$titles = array(); + +foreach( $pages as $page ){ + $titles[] = Title::newFromText( $page ); +} + +$batch = new LinkBatch( $titles ); +$batch->execute(); \ No newline at end of file -- cgit v1.2.2