This page describes some of the internal workings of PmWiki by explaining how some of the functions in pmwiki.php work. For a more brief list/overview on functions useful to for instance cookbook writers, see Cookbook:Functions.
This function should always be used, passing parameters to functions called via
preg_replace. Especially when defining a replacement with
Markup() function. It removes the escape in front of quotation marks. This function is frequently used in
for example in the definition of the
This function should always be used when processing the contents of
_GET variables. It verifies
get_magic_quotes(), if true,
strips the automatically inserted escapes from the string.
$fmt, with $variable and $[internationalisation] substitutions performed, under the assumption that the current page is
pagename. See PmWiki.Variables for an (incomplete) list of available variables, PmWiki.Internationalizations for internationalisation.
This is one of the major functions in PmWiki, see PmWiki.FmtPageName for lots of details.
This function is used to insert translation rules into the PmWiki's
translation engine. The arguments to
Markup() are all strings, where:
<xyz" says to apply this rule prior to the rule named "xyz", while "
>xyz" says to apply this rule after the rule "xyz". See CustomMarkup for more details on the order of rules.
Also see: Cookbook:Functions#MarkupToHTML
mkdirp($dir) creates a directory,
$dir, if it doesn't
already exist, including any parent directories that might be needed. For
each directory created, it checks that the permissions on the directory are
sufficient to allow PmWiki scripts to read and write files in that
directory. This includes checking for restrictions imposed by PHP's
safe_mode setting. If
mkdirp() is unable to successfully create a
mkdirp() aborts with an error message telling the
administrator the steps to take to either create $dir manually or give
PmWiki sufficient permissions to be able to do it.
MakeLink($pagename, $target, $txt, $suffix, $fmt) returns a ???. It's arguments are as follows:
$pagename is the source page $target is where the link should go $txt is the value to use for '$LinkText' in the output $suffix is any suffix string to be added to $txt $fmt is a format string to use
If $txt is NULL or not specified, then it is automatically computed from $target.
If $fmt is NULL or not specified, then MakeLink uses the default
format as specified by the type of link. For page links this
for intermap-style links it comes from either the
array or from
$UrlLinkFmt. Inside of the formatting strings,
$LinkUrl is replaced by the resolved url for the link, $LinkText
is replaced with the appropriate text, and $LinkAlt is replaced
by any "title" (alternate text) information associated with the
MakeUploadName() simply takes a string
$x (representing an attachment's
name) and converts it to a valid name by removing any unwanted characters.
It also requires the name to begin and end with an alphanumeric character,
and as of 2.0.beta28 it forces any file extensions to lowercase.
This function is defined in
scripts/upload.php and only used when uploads