목차
Environment
Global Variables
$ACT
현재의 행동(action)을 담고 있습니다. 행동의 종류에 대해서는 Action Modes. (reference) 참조.
$auth
$auth
는 현재 사용되고 있는 상용자인증법authentication backend 의 인스턴스를 나타냅니다.
(reference)
$conf
$conf
는 도쿠위키 설정에서 지정된 모든 내용들을 배열형태로 담고 있습니다. 일반적으로 다음과 같은 구조를 지닙니다.
$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['tpl'][<template_name>][<setting_name>]
— Template configuration settings, refer to the template 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.
일반적으로 이 배열에 직접 접근할 필요는 없습니다. 플러긴과, 템플릿에서 각자의 설정에 접근하는 방법을 따로 가지고 있습니다.
$ID
현재 작업된 페이지이름 pagename 을 담고 있습니다. 이 페이지는 대개 지금 보여지고 있는 페이지이지만, 꼭 그런 것은 아닙니다. 아래의
$INFO['id']
를 참고하세요. (reference)
$INFO
연관 배열 (associative array)로서 inc/common.php
의 함수에서 제공하는 여러 정보들을 담고 있습니다. pageinfo().
현재 요소는 다음과 같습니다:
rev
— 현재 보여지는 페이지의 판본 일반적으로 $REV 와 같다.userinfo
— 로그인한 경우 설정되는 내용으로 연관배열입니다.pass
— 암호화된 사용자 암호name
— 이름mail
— 이메일 주소grps
— 사용자가 속한 그룹 (배열 )buid
— a special id constructed from details of the user's browser and IP address
perm
— 현재 페이지에 대한 사용자의 권리 ($ID)subscribed
— 현재 페이지를 사용자가 추적하고 있다면, true 아니면 falsenamespace
— the namespace the current page ($ID) belongs tolocked
— true if the page is locked, false otherwisefilepath
— the file system path to the raw wiki data for the current page ($ID+$REV)exists
— true if the raw wiki data for the current page exists ($ID+$REV), false otherwiserev
— the revision id for the current page ($ID), an empty string if the current revisionwritable
— true if for the current page ($ID+$REV) the combination of file existence, file permissions and the user's ACL permissions allow them to, write to an existing file or to create a nonexistent file. False otherwise.editable
— true if the current page ($ID+$REV) is writable and not currently locked.lastmod
— timestamp of the last modification to the current page ($ID+$REV)meta
— metadata for the current page ($ID)ip
— IP address of the last editor of the current page ($ID+$REV)user
— username of the last editor of the current page ($ID+$REV)sum
— edit summary annotation for the current page ($ID+$REV)editor
— user name (or IP address if user name is unknown) of the last editor of the current page ($ID+$REV)isadmin
— true if the currently logged in user is a superuserismanager
— true if the currently logged in user is a managerdraft
— contains the file name of a draft file if it exists for the current user and pageismobile
— true if the page is browsed from a mobile device or phoneclient
— name of a user currently logged in
On $INFO array is an example array dumped.
$lang
An associative array which hold all translation strings of the interface, plugins and templates. (reference)
$REV
Holds the revision timestamp of the currently rendered page. This is false
when the most current page is meant. (reference)
$_SERVER['REMOTE_USER']
This variable is explicitly set by DokuWiki's authentication mechanism when a user logs in and holds the users name.
$TEXT
On save
and preview
this global variable holds the text submitted via the edit form. (reference)
$TOC
This variable will, if populated, be used by tpl_toc() to build the TOC of a page. Normally this variable is empty and tpl_toc() builds the TOC from the page metadata. (reference)
$USERINFO
An globally available associative array which hold some information of a authenticated user.
- pass - hash of the users' password
- name - the users' full name
- mail - the users' mail address
- grps - array of groups the user is part of
(reference )
$JSINFO
This array contained information that is passed to the JavaScript as global variable.
Read more:
- Javascript devel docs: JSINFO
Constants
Here follows a list of the most important constants.
AUTH_<*>
The AUTH_<*>
type constants represent the permission levels, as integer value, used in DokuWiki's ACL system. They can be used to let ACL checks for a given page/namespace look a little bit more verbose.
if (auth_quickaclcheck($ID) >= AUTH_READ) { // do sth. }
AUTH_NONE
- Type: Integer
- Value: 0
AUTH_READ
- Type: Integer
- Value: 1
AUTH_EDIT
- Type: Integer
- Value: 2
AUTH_CREATE
- Type: Integer
- Value: 4
AUTH_UPLOAD
- Type: Integer
- Value: 8
AUTH_DELETE
- Type: Integer
- Value: 16
AUTH_ADMIN
- Type: Integer
- Value: 255
DOKU_<*>
The DOKU_<*>
type constants hold information about various system information for DokuWiki's internal use.
DOKU_BASE
The URL base of the DokuWiki install. (reference)
/dokuwiki/
Or if canonical is set:
http://domain.org/dokuwiki/
DOKU_REL
The URL base path to the DokuWiki install. (reference)
/dokuwiki/
DOKU_URL
The absolute URL to the DokuWiki install. (reference)
http://domain.org/dokuwiki/
DOKU_INC
The server side include path of the DokuWiki install. (reference)
/var/www/dokuwiki/
DOKU_CONF
The server side conf path of the DokuWiki install. (reference)
/var/www/dokuwiki/conf/
DOKU_TPL
The URL base path to the current used template. (reference)
/dokuwiki/lib/tpl/<template>/
Or if canonical is set:
http://domain.org/lib/tpl/<template>/
Note: this define is deprecated and should be replaced by call to tpl_basedir().
DOKU_TPLINC
The server side include path of the current used template. (reference)
/var/www/dokuwiki/lib/tpl/<template>/
Note: this define is deprecated and should be replaced by call to tpl_incdir().
DOKU_PLUGIN
The server side include path of the plugins install. (reference)
/var/www/dokuwiki/lib/plugins/