DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:environment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:environment [2011-11-06 20:47] – added DOKU_PLUGIN HåkanSdevel:environment [2023-11-05 14:50] (current) Klap-in
Line 8: Line 8:
  
 Holds the current action, see [[Action Modes]]. ([[xref>$ACT|reference]]) Holds the current action, see [[Action Modes]]. ([[xref>$ACT|reference]])
 +
 +:!: ''$ACT'' can also be an array instead of a string depending on when it is used. So if you compare it using a string comparison function (e.g. ''strcmp()'', ''strncmp()'') then you better make sure that it is not an array using ''!is_array($ACT)''. Otherwise the result may be undefined. :!:
 +
 +:!: If you are handling an [[devel:event:ACTION_ACT_PREPROCESS]] event, use ''%%$event->data%%'' instead of ''$ACT''.
  
 ==== $auth ==== ==== $auth ====
  
-The globally available ''$auth'' object represents an instance of the used [[:auth|authentication backend]]. ([[xref>$auth|reference]])+The globally available ''$auth'' object represents an instance of the used [[:auth|authentication plugin]], which inherites from [[xref>AuthPlugin]]. ([[xref>$auth|reference]])
  
 ==== $conf ==== ==== $conf ====
Line 19: Line 23:
   * ''$conf[<setting_name>]'' --- DokuWiki settings (refer [[:config]])   * ''$conf[<setting_name>]'' --- DokuWiki settings (refer [[:config]])
   * ''$conf[<setting_group>][<setting_name>]'' --- Some DokuWiki settings use this format, e.g. ftp, proxy and target settings.   * ''$conf[<setting_group>][<setting_name>]'' --- Some DokuWiki settings use this format, e.g. ftp, proxy and target settings.
-  * ''$conf['tpl'][<template_name>][<setting_name>]'' --- Template configuration settings, refer to the template documentation.+  * ''$conf['tpl'][<template_name>][<setting_name>]'' --- Template configuration settings, refer to the template documentation. Note only one template at a time is enabled.
   * ''$conf['plugin'][<plugin_name>][<setting_name>]'' --- Plugin configuration settings, refer to the plugin documentation.   * ''$conf['plugin'][<plugin_name>][<setting_name>]'' --- Plugin configuration settings, refer to the plugin documentation.
-  * ''$conf['auth'][<auth_name>][<setting_name>]'' --- Auth backend settings, refer to the auth backend documentation.+  * ''$conf['plugin'][<auth_plugin_name>][<setting_name>]'' --- Auth plugin settings, refer to the auth plugin documentation.
  
 Normally you don't need to access this array directly. Both, Plugins and Templates have their own methods to accessing their respective configuration settings. Normally you don't need to access this array directly. Both, Plugins and Templates have their own methods to accessing their respective configuration settings.
Line 65: Line 69:
   * ''client'' --- name of a user currently logged in    * ''client'' --- name of a user currently logged in 
  
 +On [[infoarray|$INFO array]] is an example array dumped.
 ==== $lang ==== ==== $lang ====
  
Line 71: Line 76:
 ==== $REV ==== ==== $REV ====
  
-Holds the revision timestamp of the currently rendered page. This is ''false'' when the most current page is meant. ([[xref>$REV|reference]])+Holds the revision timestamp of the currently rendered page. This is ''%%''%%'' (empty string) when the most current page is meant. ([[xref>$REV|reference]])
  
 ==== $_SERVER['REMOTE_USER'] ==== ==== $_SERVER['REMOTE_USER'] ====
  
 This variable is explicitly set by DokuWiki's authentication mechanism when a user logs in and holds the users name. This variable is explicitly set by DokuWiki's authentication mechanism when a user logs in and holds the users name.
 +<code php>
 +$userid = $INPUT->server->str('REMOTE_USER');
 +</code>
  
 ==== $TEXT ==== ==== $TEXT ====
Line 87: Line 95:
 ==== $USERINFO ==== ==== $USERINFO ====
  
-An globally available associative array which hold some information of **authenticated** user.+An globally available associative array which hold some information of an **authenticated** user.
  
   * pass - hash of the users' password   * pass - hash of the users' password
Line 94: Line 102:
   * grps - array of groups the user is part of   * grps - array of groups the user is part of
  
-([[xref>$USERINFO|reference]])+If logged out, or not logged in, this global is set to null.
  
 +([[xref>$USERINFO|reference]] )
 +
 +The array is filled in [[xref>auth_setCookie()]] after login, or from existing session [[xref>auth_login()]]. Or if the authentication plugin uses [[xref>trustExternal()]], it is already set there.
 ==== $JSINFO ==== ==== $JSINFO ====
  
 This array contained information that is passed to the JavaScript as global variable. This array contained information that is passed to the JavaScript as global variable.
  
-see [[devel:javascript#jsinfo]] +Read more: 
 +  * Javascript devel docs: [[devel:javascript#JSINFO]] 
 +  * [[xref>$JSINFO|reference]]
 ===== Constants ===== ===== Constants =====
  
Line 177: Line 189:
  
 === DOKU_URL === === DOKU_URL ===
 +
  
 The absolute URL to the DokuWiki install. ([[xref>DOKU_URL|reference]]) The absolute URL to the DokuWiki install. ([[xref>DOKU_URL|reference]])
Line 198: Line 211:
 === DOKU_TPL === === DOKU_TPL ===
  
-The URL base path to the current used template. ([[xref>DOKU_TPL|reference]])+([[deprecated]]) The URL base path to the current used template. ([[xref>DOKU_TPL|reference]])
  
   /dokuwiki/lib/tpl/<template>/   /dokuwiki/lib/tpl/<template>/
Line 205: Line 218:
  
   http://domain.org/lib/tpl/<template>/   http://domain.org/lib/tpl/<template>/
 +
 +Note: this define is [[deprecated]] and should be replaced by call to [[xref>tpl_basedir()]].
  
 === DOKU_TPLINC === === DOKU_TPLINC ===
  
-The server side include path of the current used template. ([[xref>DOKU_TPLINC|reference]])+([[deprecated]]) The server side include path of the current used template. ([[xref>DOKU_TPLINC|reference]])
  
   /var/www/dokuwiki/lib/tpl/<template>/   /var/www/dokuwiki/lib/tpl/<template>/
      
 +
 +Note: this define is [[deprecated]] and should be replaced by call to [[xref>tpl_incdir()]].
  
 === DOKU_PLUGIN === === DOKU_PLUGIN ===
Line 219: Line 236:
   /var/www/dokuwiki/lib/plugins/   /var/www/dokuwiki/lib/plugins/
  
-  +===== Request Variables ===== 
 + 
 +Since 2012-09-10 “Adora Belle”, request variables are accessible through the [[xref>Input]] class. For further information please have a look at [[devel:request_vars]].
  
devel/environment.1320608832.txt.gz · Last modified: 2011-11-06 20:47 by HåkanS

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki