Manual:GlobalFunctions.php/ko
| 미디어위키 파일: GlobalFunctions.php | |
|---|---|
| 위치: | includes/ |
| 소스 코드: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| 클래스: | 코드 검색 • 설명문서 검색 |
GlobalFunctions.php is a file that contains global functions, including such important functions as wfMessage, which is used for internationalisation.
- wfMessage (replaces the now deprecated wfMsg and wfMsgExt)
- wfRunHooks(), called Hooks:run() which was later replaced by HookContainer.
Functions
wfFindFile()
| 미디어위키 버전: | ≤ 1.38 |
(1.34에서 구식화됨)
(1.39 에서 제거됨)
Use MediaWikiServices::getInstance()->getRepoGroup()->findFile() instead.
Passing a string (with a file name) or a Title object, returns a File object, or false if the file does not exist.
It's a shortcut for RepoGroup::singleton()->findFile().
Use RepoGroup::singleton()->getLocalRepo()->findFile() if you need to get files only from the local repository.
wfRunHooks()
| 미디어위키 버전: | ≤ 1.32 |
(1.32 에서 제거됨)
wfRunHooks() example usage, from WikiPage: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()
wfRandom() is used to populate page.page_random.
wfBaseConvert()
(1.27에서 구식화됨)
(1.31 에서 제거됨)
Use Wikimedia\base_convert() directly.
The function used to generate the base-36 SHA-1 text content hash in revision.rev_sha1 is wfBaseConvert( sha1( $text ), 16, 36, 31 ).
API modules like ApiQueryRevisions use wfBaseConvert( $revision->getSha1(), 36, 16, 40 ).
wfTempDir()
This function attempts to get the system directory for temporary files.
wfIsCLI()
| 미디어위키 버전: | ≥ 1.31 Gerrit change 401682 |
Returns true if the code is being run from the command line.