Посібник:MediaWiki.php
Appearance
Outdated translations are marked like this.
| Файл MediaWiki: MediaWiki.php | |
|---|---|
| Розташування: | includes/ |
| Вихідний код: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Класи: | MediaWiki |
Опис
This page is outdated. |
Серед іншого, цей файл містить:
- * Функцію
run, що викликається з index.php. Запускає поточний екземпляр MediaWiki, викликаючиcheckMaxLag,main,triggerJobsіrestInPeace. - * Функцію
checkMaxLag: перевіряє, чи максимальне відставання ведених баз даних перевищує параметрmaxlag, і якщо це так, виводить повідомлення про помилку. В основному вона використовується в запитах до api.php, які явно викликаються у версіях ApiMain.php до 1.19, і з 1.19 вона також працює для запитів index.php. - * Функцію
main, яка створює об'єкт Title залежно від параметраtitle, переданого до index.php. Якщо передано параметрcurid, то він перекриєtitle. Якщо не передано параметрcuridі передано параметрoldid, то він перекриєtitle, якщо це не спеціальна сторінка. - 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
performActionifinitializeArticlereturned an article, or - Calls
redirectifinitializeArticlereturned a string.
- 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 - A string if it's an interwiki redirect or a redirect to a special page
- An article object, which will be passed
- Function
performAction(called byperformRequest) which performs most actions, including creating the HTML. For example, in the case of viewing a page, function "view" in Article.php is called. - 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 fromrun(it was called fromrestInPeacebefore 1.23).
ArticleFromTitle(introduced in 1.8) now is moved into Article.phpMediaWikiPerformAction(introduced in 1.12)UnknownAction(deprecated in 1.19)(removed in 1.33)InitializeArticleMaybeRedirect(introduced in 1.13)CustomEditor(introduced in 1.9.1) now is moved into EditAction.phpBeforeInitialize(introduced in 1.16)