Codex

A simple list of the functions provided by PmWiki. Eventually to be fleshed out with more descriptions, and links to appropriate pages.

pmwiki.php:

Helper functions

SDV(&$v,$x)?"set default value" -- assigns $x to $v only if $v isn't already defined
SDVA(&$var,$val)"set default value array" -- assign array $val to $var for undefined elements
PUE($x)url encode $x
IsEnabled(&$var,$f=0)returns $var if it's set, otherwise returns $f
mkdirp($dir)create $dir if it doesn't exist (with appropriate permissions)
fixperms($fname, $add = 0)correct file permissions on $fname
stripmagic($x)undo any effects of PHP's (broken) magic_quotes setting
Lock($op)provide a semaphore for wiki processes (avoid read/write conflicts)
ParseArgs($x)parse strings containing lists of arguments
StopWatch($x)mark elapsed time in processing

Markup helper functions

PSS($x) - strip backslashes (added by the /e option to preg_replace) from $x. functions PVS($x) - Convert \n\n sequences to <:vspace> PVSE($x) - Convert special characters to HTML entities (excluding quotes) and convert \n\n sequences to <:vspace> PZZ($x,$y='') - return a null string (used for its side effect of evaluating $x and $y) PRR($x=NULL) - indicate that we need to restart markup processing PQA($x) - "prepare quoted arguments" -- quote any attributes in HTML tags NoCache($x='') - indicate that current page is not to be cached

Markup functions

CompareArgs($arg) CondAuth($pagename, $condparm) CondExpr($pagename, $condname, $condparm) SetTmplDisplay($var, $val) AsSpaced($text) MatchPageNames($pagelist, $pat) FixGlob($x, $rep = '$1*.$2') ResolvePageName($pagename) MakePageName($basepage,$x) PCache($pagename, $page) SetProperty($pagename, $prop, $value, $sep = NULL) PageVar($pagename, $var, $pn = '') FmtPageName($fmt, $pagename) XL($key) XLSDV($lang,$a) XLPage($lang,$p) CmpPageAttr($a, $b) PageStore($d='$WorkDir/$FullName', $w=0) pagefile($pagename) read($pagename, $since=0) write($pagename,$page) exists($pagename) delete($pagename) ls($pats=NULL) ReadPage($pagename, $since=0) - returns array, each element contains a single line split by '=' to array($key => $value) WritePage($pagename,$page) PageExists($pagename) ListPages($pat=NULL) RetrieveAuthPage($pagename, $level, $authprompt=true, $since=0) - recieve page by using authentication mechanisms (hookable) (reference) Abort($msg) Redirect($pagename,$urlfmt='$PageUrl') PrintFmt($pagename,$fmt) PrintWikiPage($pagename, $wikilist=NULL, $auth='read') Keep($x, $pool=NULL) - the $x string is passed on unaltered to the output CondText($pagename,$condspec,$condtext) IncludeText($pagename, $inclspec) RedirectMarkup($pagename, $opt) Block($b) FormatTableRow($x) WikiLink($pagename, $word) LinkIMap($pagename,$imap,$path,$title,$txt,$fmt=NULL) LinkPage($pagename,$imap,$path,$title,$txt,$fmt=NULL) MakeLink($pagename,$tgt,$txt=NULL,$suffix=NULL,$fmt=NULL) - creates a link with the proper site info, see MakeLink Markup($id,$cmd,$pat=NULL,$rep=NULL) DisableMarkup() mpcmp($a,$b) { return @strcmp($a['seq'].'=',$b['seq'].'='); } BuildMarkupRules() MarkupToHTML($pagename, $text, $opt = NULL) HandleBrowse($pagename, $auth = 'read') EditTemplate($pagename, &$page, &$new) RestorePage($pagename,&$page,&$new,$restore=NULL) ReplaceOnSave($pagename,&$page,&$new) SaveAttributes($pagename,&$page,&$new) PostPage($pagename, &$page, &$new) PostRecentChanges($pagename,&$page,&$new) PreviewPage($pagename,&$page,&$new) HandleEdit($pagename, $auth = 'edit') HandleSource($pagename, $auth = 'read') PmWikiAuth($pagename, $level, $authprompt=true, $since=0) - recieve page by using authentication mechanisms IsAuthorized($chal, $source, &$from) SessionAuth($pagename, $auth = NULL) PrintAttrForm($pagename) HandleAttr($pagename, $auth = 'attr') HandlePostAttr($pagename, $auth = 'attr') HandleLogoutA($pagename, $auth = 'read') HandleLoginA($pagename, $auth = 'login')

scripts/author.php:

RequireAuthor($pagename, &$page, &$new)

scripts/authuser.php:

AuthUserId($pagename, $id, $pw=NULL) AuthUserConfig($pagename, $id, $pw, $pwlist) AuthUserHtPasswd($pagename, $id, $pw, $pwlist) AuthUserLDAP($pagename, $id, $pw, $pwlist) _crypt($plain, $salt=null)

scripts/compat1x.php:

ConvertV1WikiD($path) is a that allows pages to be converted read($pagename) UseV1WikiD($path) ConvertV1WikiD($path)

scripts/crypt.php:

HandleCrypt($pagename, $auth='read')

scripts/diag.php:

Ruleset() HandleRuleset($pagename) StopWatchHTML()

scripts/draft.php:

EditDraft(&$pagename, &$page, &$new)

scripts/feeds.php:

HandleFeed($pagename, $auth = 'read') RSSEnclosure($pagename, &$page, $k)

scripts/forms.php:

InputMarkup($pagename, $type, $args)

scripts/guiedit.php:

GUIButtonCode($pagename)

scripts/httpauth.php:

HTTPBasicAuthPrompt($pagename)

scripts/notify.php:

NotifyCheck($pagename) PostNotify($pagename, &$page, &$new) NotifyUpdate($pagename, $dir='')

scripts/pagelist.php:

SearchBox($pagename, $opt) FmtPageList($outfmt, $pagename, $opt) MakePageList($pagename, $opt, $retpages = 1) SortPageList(&$matches, $order) HandleSearchA($pagename, $level = 'read') FPLTemplate($pagename, &$matches, $opt) PageIndexTerms($terms) PageIndexUpdate($pagelist, $dir = '') PageIndexGrep($terms, $invert = false) PostPageIndex($pagename, &$page, &$new)

scripts/pagerev.php:

LinkSuppress($pagename,$imap,$path,$title,$txt,$fmt=NULL) PrintDiff($pagename) HandleDiff($pagename, $auth='read')

scripts/phpdiff.php:

PHPDiff($old,$new)

scripts/simuledit.php:

Merge($newtext,$oldtext,$pagetext) MergeSimulEdits($pagename,&$page,&$new)

scripts/skins.php:

SetSkin($pagename, $skin) LoadPageTemplate($pagename,$tfilefmt) PrintSkin($pagename, $arg)

scripts/stdmarkup.php:

PreserveText($sigil, $text, $lead) PrintMetaTags($pagename, $args) TrackAnchors($x) { global $SeenAnchor; return @$SeenAnchor[$x]++; } WSIndent($i) Cells($name,$attr) MarkupMarkup($pagename, $text, $opt = '') CondDate($condparm)

scripts/trails.php:

ReadTrail($pagename,$trailname) MakeTrailStop($pagename,$trailname) MakeTrailStopB($pagename,$trailname) MakeTrailPath($pagename,$trailname)

scripts/transition.php:

FPLByGroup($pagename, &$matches, $opt) GUIEdit($pagename, &$page, &$new)

scripts/upload.php:

MakeUploadName($pagename,$x) LinkUpload($pagename, $imap, $path, $title, $txt, $fmt=NULL) HandleUpload($pagename, $auth = 'upload') HandleDownload($pagename, $auth = 'read') HandlePostUpload($pagename, $auth = 'upload') UploadVerifyBasic($pagename,$uploadfile,$filepath) dirsize($dir) FmtUploadList($pagename, $args) AttachExist($pagename) scripts/urlapprove.php: LinkHTTP($pagename,$imap,$path,$title,$txt,$fmt=NULL) ReadApprovedUrls($pagename) HandleApprove($pagename, $auth='edit') BlockUnapprovedPosts($pagename, &$page, &$new)

scripts/vardoc.php:

VarLink($pagename,$tgt,$txt) VarIndexLoad($pagename) VarIndexList($pagename)

scripts/wikistyles.php:

ApplyStyles($x)

scripts/xlpage-utf-8.php:

utf8toupper($x)

Category: PmWiki Internals PmWiki Developer

This page may have a more recent version on pmwiki.org: PmWiki:FunctionList, and a talk page: PmWiki:FunctionList-Talk.