The PHP Transform Environment

From Organic Design wiki
Revision as of 20:26, 30 October 2006 by Bender (talk | contribs) (Caretaker: Format cat links)

The runtime environment available to PHP transforms is as follows:

Local Variables
  • $article the text content of the current article
  • $title the title of the current article
  • $properties the properties DOM object of the current article
  • $tCode the PHP code of the currently executing transform
  • $tTitle the article title of the currently executing transform
  • $tProperties the properties DOM object for the currently executing transform
  • $event the event that called this transform (eg. data, view, edit, save)
  • $path the path into the properties object of this transform's data elements
  • $script the currently executing script (index.php)
Globals
  • $xwUserName the name of the currently logged in user
  • $xwUserSYS the DOM object of the users Sys:User XML article
  • $xwUserGroups the groups this user belongs to
  • $xwEdit true if editing the current article
  • $xwView true if viewing the current article
  • $xwRaw true if the article should be returned without the surrounding site template
  • $xwPreview true if previewing the article
  • $xwSave true if saving the article
  • $xwArticleTitle the title of the current article
  • $xwArticle the text of the current article
  • $xwArticleProperties the DOM object of the current article's properties
  • $xwIsProperties true if current article is an XML properties article
  • $xwIsSystem true if current article is an XML Sys:User article
  • $xwIsUser true if user is logged in and not an anonymous IP address
  • $xwIsAdmin true if user is an XmlWiki administrator
MediaWiki
  • $wgArticle
  • $wgUser
  • $wgTitle
  • $wgParser