Difference between revisions of "Globals.doc (MediaWiki)"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (MediaWikiDoc:Globals.doc moved to Globals.doc (MediaWiki))
m (belated post-import cleanup)
 
Line 1: Line 1:
[[Techniques]]:
+
[[Computing]]: [[Software]]: [[MediaWiki]]: [[Globals.doc (MediaWiki)|Globals.doc]]
Software: [[MediaWiki]]: [[MediaWikiDoc:Developer Documents|Developer
 
Documents]]: [[MediaWikiDoc:Globals.doc|Globals.doc]]
 
 
==Contents==
 
==Contents==
 
PHP loves globals. I hate them. This is not a great combination, but I
 
PHP loves globals. I hate them. This is not a great combination, but I
Line 10: Line 8:
 
or maintainability, so I go with the flow of PHP and use globals.
 
or maintainability, so I go with the flow of PHP and use globals.
 
Here's documentation on the important globals used by the system.
 
Here's documentation on the important globals used by the system.
*'''$wgOut''': OutputPage object for HTTP response. *'''$wgTitle''':
+
 
Title object created from the request URL. *'''$wgLang''': Language
+
*'''$wgOut''': OutputPage object for HTTP response.
object for this request. *'''$wgArticle''': Article object
+
*'''$wgTitle''': Title object created from the request URL.
corresponsing to $wgTitle. *'''$wgLinkCache''': LinkCache object.
+
*'''$wgLang''': Language object for this request.
 +
*'''$wgArticle''': Article object corresponsing to $wgTitle.
 +
*'''$wgLinkCache''': LinkCache object.
 
==Edit Log==
 
==Edit Log==
*'''2005-06-13''' Transcribed from docs for MediaWiki version 1.4.5
+
* '''2005-12-07''' Belated post-import cleanup
 +
* '''2005-06-13''' Transcribed from docs for MediaWiki version 1.4.5

Latest revision as of 15:55, 7 December 2005

Computing: Software: MediaWiki: Globals.doc

Contents

PHP loves globals. I hate them. This is not a great combination, but I manage. I could get rid of most of them by having a single "HTTP request" object, and using it to hold everything that's now global (which is exactly what I'd do in a Java servlet). But that's really awkward in PHP, and wouldn't really provide much benefit in readability or maintainability, so I go with the flow of PHP and use globals. Here's documentation on the important globals used by the system.

  • $wgOut: OutputPage object for HTTP response.
  • $wgTitle: Title object created from the request URL.
  • $wgLang: Language object for this request.
  • $wgArticle: Article object corresponsing to $wgTitle.
  • $wgLinkCache: LinkCache object.

Edit Log

  • 2005-12-07 Belated post-import cleanup
  • 2005-06-13 Transcribed from docs for MediaWiki version 1.4.5