The PHP Transform Environment

From Organic Design wiki
Legacy.svg Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, this is only useful for a historic record of work done. You may find a link to the currently used concept or function in this article, if not you can contact the author to find out what has taken the place of this legacy item.

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