MediaWiki file: GlobalFunctions.php | |
---|---|
Location: | includes/ |
Source code: | master •1.44.0 •1.43.3 •1.39.13 |
Classes: | Find code •Find documentation |
GlobalFunctions.php is a file that contains global functions, including such important functions as wfMessage, which is used forinternationalisation.
MediaWiki version: | ≤ 1.38 |
(deprecated in 1.34)(removed in 1.39)UseMediaWikiServices::getInstance()->getRepoGroup()->findFile()
instead.
Passing a string (with a file name) or aTitle object, returns aFile object, orfalse
if the file does not exist.It's a shortcut forRepoGroup::singleton()->findFile()
.UseRepoGroup::singleton()->getLocalRepo()->findFile()
if you need to get files only from the local repository.
MediaWiki version: | ≤ 1.32 |
(removed in 1.32)wfRunHooks() example usage, fromWikiPage:doEditContent():
$hook_args=array(&$this,&$user,$content,$summary,$flags&EDIT_MINOR,null,null,&$flags,$revision,&$status,$baseRevId);ContentHandler::runLegacyHooks('ArticleSaveComplete',$hook_args);wfRunHooks('PageContentSaveComplete',$hook_args);
wfRandom() is used to populatepage.page_random.
(deprecated in 1.27)(removed in 1.31)Use Wikimedia\base_convert() directly.The function used to generate the base-36 SHA-1 text content hash inrevision.rev_sha1 iswfBaseConvert( sha1( $text ), 16, 36, 31 )
.API modules likeApiQueryRevisions usewfBaseConvert($revision->getSha1(),36,16,40)
.
This function attempts to get the system directory for temporary files.
MediaWiki version: | ≥ 1.31 Gerrit change 401682 |
Returnstrue
if the code is being run from the command line.