Midgard PHP Superglobal

From OpenPSA Wiki

Jump to: navigation, search

The $_MIDGARD superglobal was introduced in Midgard 1.6.0 and is an array containing runtime information about the Midgard environment. The following array members are populated:

  • admin contains TRUE or FALSE depending whether current user is an Sitegroup administrator
  • argc contains an integer counting number of items in the virtual path
  • argv contains an array of items in the virtual path
  • auth contains TRUE or FALSE depending whether authentication was successful for current request
  • config is an array containing configuration information:
    • prefix is the installation prefix used for Midgard, as reported by the midgard-config --prefix command
    • multilang contains TRUE or FALSE depending whether the Multilang module is enabled
    • quota contains TRUE or FALSE depending whether the Quota module is enabled
  • debug tells whether the mgd_debug_start function has been called
  • host is the database ID of the current Host record
  • lang contains the current language code
  • page is the database ID of the current Page record
  • prefix contains the Host prefix (f.x. "/" or "/myprefix")
  • root contains TRUE or FALSE depending whether current user is an root administrator
  • schema is an array containing information about loaded Midgard schemas
    • types is an array containing list of loaded schema types
  • self contains the path of the current Page record without virtual path information
  • sitegroup contains the database ID of the current sitegroup
  • style is the database ID of the current loaded Style
  • types contains an array of registered midgard types
  • uri contains the full virtual path of the current Midgard request
  • user is the database ID of the current authenticated user, or 0

[edit] deprecated

  • cookieauth contains TRUE or FALSE depending whether cookie was send for current authenticated request xxxxxxxxxxxxxxxxxx

See also: MidCOM PHP Superglobal

Personal tools