Difference between revisions of "MediaWikiDoc:Code"
Jump to navigation
Jump to search
m (function links) |
|||
Line 5: | Line 5: | ||
*For the purpose of displaying a page (not saving changes or doing anything else), this calls $wgArticle->view(), in [[MediaWikiDoc:Article.php|Article.php]] (line 699) | *For the purpose of displaying a page (not saving changes or doing anything else), this calls $wgArticle->view(), in [[MediaWikiDoc:Article.php|Article.php]] (line 699) | ||
*$wgArticle->view() appears to be able to provide a few other formats besides the regular view (including difference engine and displaying redirections as subtitles), but I'm ignoring that for now | *$wgArticle->view() appears to be able to provide a few other formats besides the regular view (including difference engine and displaying redirections as subtitles), but I'm ignoring that for now | ||
*$wgOut seems to be the object which accumulates text to be output, via various methods: | *$wgOut seems to be the object which accumulates text to be output. It is created in [[MediaWikiDoc:Setup.php|Setup.php]]: | ||
**$wgOut->addWikiText(...) | **$wgOut = new OutputPage(); | ||
**$wgOut->addHTML(...) | *OutputPage() is defined in [[MediaWikiDoc:OutputPage.php|OutputPage.php]] | ||
**$wgOut->addPrimaryWikiText() # Display content and save to parser cache | *After being created, $wgOut accumulates output via various class methods: | ||
**$wgOut->addWikiText() # Display content, don't attempt to save to parser cache | **$wgOut->[[MediaWikiDoc:OutputPage.php#function addWikiText|addWikiText]](...) | ||
**$wgOut->setPageTitle() | **$wgOut->[[MediaWikiDoc:OutputPage.php#function addHTML|addHTML]](...) | ||
**$wgOut->transformBuffer(); # Put link titles into the link cache | **$wgOut->[[MediaWikiDoc:OutputPage.php#function addPrimaryWikiText|addPrimaryWikiText]]() # Display content and save to parser cache | ||
**$wgOut->addMetaTags(); # Add link titles as META keywords | **$wgOut->[[MediaWikiDoc:OutputPage.php#function addWikiText|addWikiText]]() # Display content, don't attempt to save to parser cache | ||
**$wgOut->[[MediaWikiDoc:OutputPage.php#function setPageTitle|setPageTitle]]() | |||
**$wgOut->[[MediaWikiDoc:OutputPage.php#function transformBuffer|transformBuffer]](); # Put link titles into the link cache | |||
**$wgOut->[[MediaWikiDoc:OutputPage.php#function addMetaTags|addMetaTags]](); # Add link titles as META keywords | |||
*...and then it does these two lines: | *...and then it does these two lines: | ||
**$this->viewUpdates(); ''(found at line 1926 -- doesn't do much)'' | **$this->viewUpdates(); ''(found at line 1926 -- doesn't do much)'' | ||
**wfProfileOut( $fname ); | **wfProfileOut( $fname ); | ||
*It's not clear whether the navbar has already been pulled in by the time we hit viewUpdates -- possibly transformBuffer does it? The comment makes it sound like that, but the name "transformBuffer" in that case is not very descriptive. The code in there should probably be examined. | *It's not clear whether the navbar has already been pulled in by the time we hit viewUpdates -- possibly transformBuffer does it? The comment makes it sound like that, but the name "transformBuffer" in that case is not very descriptive. The code in there should probably be examined. |
Revision as of 20:14, 16 June 2005
How A Page is Built
(From Woozle 21:59, 15 Jun 2005 (EDT).)
- Everything obviously starts with index.php
- For the purpose of displaying a page (not saving changes or doing anything else), this calls $wgArticle->view(), in Article.php (line 699)
- $wgArticle->view() appears to be able to provide a few other formats besides the regular view (including difference engine and displaying redirections as subtitles), but I'm ignoring that for now
- $wgOut seems to be the object which accumulates text to be output. It is created in Setup.php:
- $wgOut = new OutputPage();
- OutputPage() is defined in OutputPage.php
- After being created, $wgOut accumulates output via various class methods:
- $wgOut->addWikiText(...)
- $wgOut->addHTML(...)
- $wgOut->addPrimaryWikiText() # Display content and save to parser cache
- $wgOut->addWikiText() # Display content, don't attempt to save to parser cache
- $wgOut->setPageTitle()
- $wgOut->transformBuffer(); # Put link titles into the link cache
- $wgOut->addMetaTags(); # Add link titles as META keywords
- ...and then it does these two lines:
- $this->viewUpdates(); (found at line 1926 -- doesn't do much)
- wfProfileOut( $fname );
- It's not clear whether the navbar has already been pulled in by the time we hit viewUpdates -- possibly transformBuffer does it? The comment makes it sound like that, but the name "transformBuffer" in that case is not very descriptive. The code in there should probably be examined.