linkcache.txt 973 B

12345678910111213141516171819202122232425
  1. linkcache.txt
  2. The LinkCache class maintains a list of article titles and the information about
  3. whether or not the article exists in the database. This is used to mark up links
  4. when displaying a page. If the same link appears more than once on any page,
  5. then it only has to be looked up once. In most cases, link lookups are done in
  6. batches with the LinkBatch class, or the equivalent in Parser::replaceLinkHolders(),
  7. so the link cache is mostly useful for short snippets of parsed text (such as
  8. the site notice), and for links in the navigation areas of the skin.
  9. The link cache was formerly used to track links used in a document for the
  10. purposes of updating the link tables. This application is now deprecated.
  11. To create a batch, you can use the following code:
  12. $pages = array( 'Main Page', 'Project:Help', /* ... */ );
  13. $titles = array();
  14. foreach( $pages as $page ){
  15. $titles[] = Title::newFromText( $page );
  16. }
  17. $batch = new LinkBatch( $titles );
  18. $batch->execute();