Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:GlobalFunctions.php

From mediawiki.org
Translate this page
Languages:
MediaWiki file: GlobalFunctions.php
Location:includes/
Source code:master1.44.01.43.31.39.13
Classes:Find codeFind documentation

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

Functions

[edit]

wfFindFile()

[edit]
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.

wfRunHooks()

[edit]
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()

[edit]

wfRandom() is used to populatepage.page_random.

wfBaseConvert()

[edit]

(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).

wfTempDir()

[edit]

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

wfIsCLI()

[edit]
MediaWiki version:
1.31
Gerrit change 401682

Returnstrue if the code is being run from the command line.

See also

[edit]
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:GlobalFunctions.php&oldid=7632058"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp