Manual:MediaWiki.php
Appearance
| MediaWiki ファイル: MediaWiki.php | |
|---|---|
| 場所: | includes/ |
| ソース コード: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| クラス: | MediaWiki |
説明
このページは直近の情報を反映していません。 |
このファイルには、特に以下のものが含まれています:
- Function
run, called from index.php. Run the current MediaWiki instance, callingcheckMaxLag,main,triggerJobsandrestInPeace.
- Function
checkMaxLag: check if the maximum lag of database slaves is higher thanmaxlagparameter, and if it's the case, output an error message.
It's primarily used in requests to api.php, explicitly called by ApiMain.php before 1.19, although since 1.19 it works for index.php requests too.
If the curid parameter is passed, it will override the title. If the curid parameter isn't passed and the oldid parameter is passed, it will override the title if it's not a special page.
- Function
performRequest(before version 1.18 it was calledperformRequestForTitle, and before version 1.16 it was calledinitialize) which does the most of the work. It:
- Checks for invalid titles, or read permission errors
- Performs interwiki redirects and canonical redirects
- If it's a special page, calls the special page code
- Calls
initializeArticle, and
- Calls
- Calls
performActionifinitializeArticlereturned an article, or
- Calls
- Calls
redirectifinitializeArticlereturned a string.
- Calls
- Function
initializeArticle, which creates an Article object from the Title given.
Then it checks if it is a redirect and if it's the case, recreate another Article from the target of the redirect and changes $wgTitle. It can return either:
- An article object, which will be passed
performActionto execute the requested action
- An article object, which will be passed
- A string if it's an interwiki redirect or a redirect to a special page
- Function
performAction(called byperformRequest) which performs most actions, including creating the HTML.
例えば、ページを閲覧する際、Article.php 内の関数「view」が呼び出されます。
- Function
restInPeace(called byrun) which does the following:
- Perform deferred updates
- Commit any database transactions
- Function
triggerJobs(doJobsbefore 1.23), which runs zero, one or more jobs from the Job queue, depending on$wgJobRunRate.
Called from run (it was called from restInPeace before 1.23).
ArticleFromTitle(1.8 で導入) now is moved into Article.phpMediaWikiPerformAction(1.12 で導入)UnknownAction(1.19 で廃止予定)(1.33 で除去)InitializeArticleMaybeRedirect(1.13 で導入)CustomEditor(1.9.1 で導入) now is moved into EditAction.phpBeforeInitialize(1.16 で導入)