Эта страница —неполный список параметровindex.php, основного скрипта программного обеспечения MediaWiki.Большая часть этих аргументов обычно передаётся в качестве GET параметров в адресной строке, но может быть также передана и через POST.POST, как правило, нужен в некоторых случаях, таких как очистка действий.
index.php параметры обычно применяются и имеют значение для страницы, к которой они применяются.Страница (или её версия) может быть определена введением одного или нескольких параметров:https://en.wikipedia.org/w/index.php?title=Ferengi&curid=177126&diff=304901009&oldid=304764764
| Название | Описание |
|---|---|
| title | Заголовок страницы. может быть wiki-страницей илиспецстраницей, в зависимости от других параметров.To disable a special page in your wiki configuration, you can use theSpecialPage_initList hook. |
| curid | id страницы вики, переопределяет значение в заголовке. |
Некоторые действия (такие как просмотр (view) и редактирование (edit)) также работают на определенной ревизии страницы. Такая ревизия определяется с помощью двух следующих параметров, позволяя опускать заголовок (title) и id страницы.
| Название | Описание |
|---|---|
| oldid | id ревизии |
| direction | Вместо ревизии, заданной вoldid, используйте:
|
Здесь приводится список значений для параметраaction.
Some of these actions can be enabled/disabled by using a dedicatedconfiguration setting inLocalSettings.php. Where available, these local settings are listed.[2]
| Name | Функция | Пример |
|---|---|---|
| view | Просмотр (view) — действие по умолчанию; просмотр — действие, которое используется, когда никакое действие явно не указано. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=view |
| watch | Добавляет страницу в список наблюдения пользователя. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=watch |
| unwatch | Удаляет страницу из списка наблюдения пользователя. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=unwatch |
| delete | Удаляет страницу. По умолчанию, | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=delete |
| revert | Возвращает прошлую версиюизображения. Требует следующих двух параметров:
| |
| rollback | Rollbacks the last edits made by the last editor of the page; in other words, it restores the last version of the article whose editor is not the last one. The edit is marked as minor and a default edit summary is used.[4] The following two other parameters are required:
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=rollback&from=John&token=d7aaa6c\ |
| protect | Отображает или изменяет уровень защиты страницы:
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=protect |
| unprotect | Same page as protect (unprotect and protect are the same page, and do the same thing). | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=unprotect |
| markpatrolled | Marks an edit as patrolled; seeHelp:Patrolled edit.
| |
| render | Outputs the HTML rendering of the entire page content; similar to theview action, but only the unstyled article text is output, not any part of the user interface (additional toolboxes, search box, stylesheets, etc.).For more stable programmatic access or to retrieve the HTML of only a piece of page content, you should use the parse API withpage orpageid parameters. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=render |
| purge | Clears the page's cache, forcing the page to be redisplayed from its source.
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=purge |
| edit | Shows the editor for the page. The editor shown depends on the user preferences.SeeРедактор. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=edit |
| submit | When viewed directly (HTTP GET), shows the editor, like "edit".
When viewing by submitting a form (HTTP POST), performs various actions related to changing the page (see#What to do below for more details):
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=submit |
| editredlink | Тоже самое что иedit.[6] | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=editredlink |
| history | Shows the history of the page. (See history, below) | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=history |
| historysubmit | When viewing the difference between revisions, after clicking "compare selected revisions" on the history page. This requires a "diff" and/or "oldid" parameter, otherwise it just shows the page itself. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=historysubmit&diff=456290&oldid=456270 |
| raw | Shows the raw content of the page. (See Raw, below) A pop up window will open up, asking whether you would like to save the page in index.php.[7] | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=raw |
| credits | Shows a list of people who contributed to the page in question using the real name specified in the user's preferences. Currently disabled on Wikimedia wikis, but is enabled by default on vanilla MediaWiki. | translatewiki.net/w/i.php?title=Translating:MediaWiki&action=credits |
| info | Shows information about the page, such as the number of users having it in their watchlist, the number of edits, the number of authors. See theReimplement info action RfC for context. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=info |
| revisiondelete | Set visibility restrictions on revision text, edit summary, and editor's username/IP address (requires deleterevision user right) |
Следующие параметры переопределяют некоторые пользовательскиенастройки. Другие параметры - "diffonly", "internaledit", и "externaledit" будут описаны в следующем разделе. Следующие параметры влияют на все действия кроме "render" и "raw".Прочие параметры, объясняемые в других секциях: "diffonly", "internaledit" и "externaledit". Перечисленные ниже параметры влияют на все действия, кроме "render" и "raw".
| Название | Функционирование | Пример |
|---|---|---|
| useskin | Определяеттему оформления (skin) | www.mediawiki.org/w/index.php?useskin=modern |
| uselang | Specify a language for the UI elements (such as the "my talk" link, etc.), i.e. theuser interface language; this is especially useful for creating an account, because at that stage no preference settings apply. The special language code " | www.mediawiki.org/w/index.php?title=Special:Userlogin&type=signup&uselang=de |
| variant | Specify a language variant for the UI elements (this is used for example in the Chinese Wikipedia, as the Chinese language has variants); | |
| printable | (устарело в 1.35)Когда задано значениеyes, страница отображается в форме, которая подходит для печати страницы. | |
| debug | When set totrue (e.g.1 ortrue), theResourceLoader serves non-minified JavaScript and CSS.SeeResourceLoader/Features#Debug mode. | www.mediawiki.org/w/index.php?title=Project:Sandbox&debug=true |
| safemode | Когда установлено вtrue (например1 илиtrue), персональный CSS и JS не будут загружаться. Это касается и гаджетов.This disables personal scripts and styles (e.g. "User:" common.js and css), and site-wide scripts and styles (e.g. "MediaWiki:Common.js" and "MediaWiki:Common.css"), and all gadgets.[8]It is possible to mark site-wide styles ("MediaWiki:Common.css") as safe via$wgAllowSiteCSSOnRestrictedPages, which permits them in safemode. | www.mediawiki.org/w/index.php?title=MediaWiki&safemode=1 |
| useskinversion | Определяет версию темы оформления[9] | www.mediawiki.org/w/index.php?title=MediaWiki&useskinversion=2 |
| vectornightmode | When set to 1, the page is shown in dark mode on skins like Vector 2022 that support dark mode. | www.mediawiki.org/w/index.php?title=MediaWiki&useskin=vector-2022&vectornightmode=1 |
View is the default action. If no other action is added to the URL,action=view is used. This action shows a page, a revision, or the difference between two revisions of the same or two different pages. Below is a (partial) list.
oldid is not passed, the difference between this revision and the previous one on the same article is shown;oldid/direction and this one is shown; the value of this parameter can be a revision ID, the valuesprev ornext to identify a revision relative to the one given byoldid/direction, and the valuecur to identify the latest revision of the page;oldid anddiff need not be two revisions of the same article, allowing two revisions of two different pages to be comparedaction=view andaction=render and only if neitheroldid nordiff is given, as this is the only case where the target article is shown instead of the redirect;diffonly=yesСледующие параметры применимы только к категориям.
from is not passed;Следующий параметр применим только к изображениям.
dir=prev is added, it works the other way around, listing all editsafter the timestamp[10]atom andrss.Can be disabled with$wgFeed.go=first the first (earliest) page of history is shownPassingaction=raw returns the source code of a page or revision. For caching and security reasons, this should generally only be used via thescript path, that is,index.php?title=....While "short urls" like/wiki/ are only meant for action=view, they unofficially tend to work for other actions as well.This is expressly discouraged for action=raw as it leads to less effective caching and bypasses automatic purging after edits.
expand, templates within the page are expanded;text/x-wiki; this can only be one of the allowed types, which currently aretext/x-wiki,text/javascript,text/css, andapplication/x-zope-editnext,prev, orcur; instead of the revision specified by oldid, returns the one following it, the one preceding it, or the current (last) one;The edit and submit actions perform almost the same action. By default, they return an "edit page" form for the page. Different results can be obtained by passing other arguments; some results (such as saving the new version of a page) can only be obtained using POST. This action takes the standard arguments for specifying a page or a page revision.
The following options produce an effect on the edit form.(Note: 'section' also affects how the page is saved. Additionally, 'preload' and 'preloadparams' only work on wikitext contentmodel)
new is used to append a new section to the document;$1 style parameters in preload text.$1 replaced byfirst value and$2 replaced bysecond value.(введено в 1.23)$1 style parameters is with<includeonly>{{SUBST:#ifeq:$1|$1|default value|$1}}</includeonly>yes orno, overrides user preference "Показывать предпросмотр, когда начинается редактирование" (T11936);file and using an external editor;undoafter revision up to theundo revision; technically, this is done by trying to merge the inverse of these edits with the sequence of all subsequent edits; the values of these parameters are IDs of old revisions of a page; if merge is not possible, a regular edit form for that revision is returnedThe following options tell the software what to do when submitting: saving, showing a preview, or showing the difference with the current version.
live argument is passed, only the rendering of the value of wpTextbox1 is shown, not the form and the other GUI element; this is similar to the result of saving and then viewing withaction=render; seeРуководство:Предварительный просмотр for more info;wpLivePreview is identical to wpPreview; therefore, a regular preview is returned iflive is not passed;The following parameters are required when a user saves a page. The edit summary field may also be required if so configured (see below).
+\ rather than a random string (seeedit token suffix).For the page to be saved,wpStarttime,wpEdittime,wpTextbox1 andwpEditToken are required in a POST request, and neitherwpPreview norwpDiff are passed.If the page was deleted afterwpStarttime, the boolean optionwpRecreate is also required.
The edit summary or the "ignore blank" parameter may be mandatory if "warn on blank summaries" is configured.
new is used to append a new section to the document.wpEditSummary is the same as this field, the edit summary has not been modified.edit parameter and display the (now-)existing page instead.This parameter is used on red links.Most special pages have additional parameters, specific to the function they perform. As an example, the parameters forSpecial:Export are outlined inРуководство:Параметры Специальный:Экспорт
The following URL parameters provide initial values for some input fields; they can be edited before submitting the form.
wpReason=other| Версии MediaWiki: | 1.10 – 1.27 |
Themaxlag parameter is used only if the software is running on a replicated database cluster.
The maxlag parameter makes it so a request is not served if there is high server traffic. maxlag parameter applies to all actions. maxlag parameter value is a number; the lower this value, the lower the traffic that causes the request not to be served. Zero is not allowed.
view, может быть запрещено с помощью использования переменной$wgActions, которая доступна для всех действий.If searches are enabled and thesearch parameter is supplied (and non-blank) then all actions are ignored and the search is performed.
wpEditToken; это происходит когда пользователь подтверждает удаление.Причина удаления передаётся как значение параметраwpReason; эта строка записывается в журнал удалений (полеlog_comment_id в таблицеlogging)Удаление также выполняется при удалении одной версии изображения; для этого требуется передача идентификатора версии в параметреoldimage и действительного токена редактирования вwpEditToken; в этом случае запрос также может быть передан через GET.summary argument is passed, its value is used as the edit summary in place of the default onebot argument is passed, the edit will be marked as a bot one (the edit is markedrc_bot=1 in therecentchanges table)bot argument can also be used on any page a [rollback] link will appear on, to cascade&bot=1 to all rollback links generatedhidediff argument is passed, the success message is shown instead of a diff of the change (this can be forced via user preferences)mwProtect-level-edit andmwProtect-level-move if the request is a POST one and a valid edit token is passed aswpEditToken; parametermwProtect-reason gives the reason for protection or unprotection which will be recorded in the page log; ifmwProtect-cascade is also passed, cascading protection is applied (all transcluded pages are set to the same protection levels)array('edit','move') and can be changed inLocalSettings.php; the protection action then accept a parametermwProtect-level-$action for each action in that arrayaction=edit&redlink=1 (see below for an explanation of the redlink parameter)index.php?title=...