Manual:GlobalFunctions.php

GlobalFunctions.php is a file that contains global functions, including such important functions as wfMsgExt, which is used for .


 *  (replaces the now deprecated wfMsg and wfMsgExt)


 * , called .

wfFindFile
Passing a string (with a file name) or a  object, returns a  object, or   if the file does not exist.

It's a shortcut for .

Use <tvar|findFile> </> if you need to get files only from the local repository.

wfRunHooks
wfRunHooks example usage, from <tvar|doEditContent></>:

wfRandom
wfRandom is used to populate <tvar|page-random></>.

wfBaseConvert
Use Wikimedia\base_convert directly.

The function used to generate the base-36 SHA-1 text content hash in <tvar|rev-sha1></> is <tvar|code> </>.

API modules like <tvar|ApiQueryRevisions></> use <tvar|code> </>.

wfTempDir
This function attempts to get the system directory for temporary files.

wfIsCLI
Returns true if the code is being run from the command line.