Manual:index.php のパラメーター

From MediaWiki.org
Jump to: navigation, search
This page is a translated version of the page Manual:Parameters to index.php and the translation is 42% complete.

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎한국어 • ‎Nederlands • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎中文

このページは MediaWiki ソフトウェアのメイン スクリプトである index.phpManual:index.php へのパラメーターの一部の一覧です。これらの多くの引数は、通常 URL の GET パラメーターで渡されますが、POST データとして渡せる場合があります。POST は実際、匿名利用者の purge (キャッシュ破棄) 操作など、一部のケースで必須です。

注 注: このページの情報は完全ではありません。[1]

ページの版やバージョン

index.php に与えられたパラメータは通常、適用され、適用されたページに関連する意味を持ちます。 ページ(あるいはその版の1つ)は、下記のパラメータを1つ以上入力して指定します。 https://en.wikipedia.org/w/index.php?title=Ferengi&curid=177126&diff=304901009&oldid=304764764

名前 説明
title ページ名です。 通常 wikiページですが、指定された他のパラメータによってはspecial pageとなる場合があります。 wiki 設定で特定のページを無効にするにはSpecialPage_initList フックを使います。
curid wikiページのidです; 指定された場合、titleの値より優先されます。

(viewとactionのような)いくつかのactionはページの特定の版に対して作用させることもできます。版は下記の2つのパラメータで指定します。上記のページ名(title)とページid(curid)を指定する必要はありません。

名前 説明
oldid 版 ID
direction oldid で指定される版の代わりに以下を使えます。
  • direction=prev: oldid の1つ前の版です
  • direction=next: oldid の1つ後の版です

操作

以下は、action パラメータの一覧です:

これらの action にはLocalSettings.phpで割り当てられた設定の指定を使って有効/無効を切り替えるものがあります。その場合、ローカル設定の一覧が表示されます。[2]

Name 機能
view view は既定の action です; view はaction が明示的に指定されない場合に使用される唯一の action です。 www.mediawiki.org/w/index.php?title=Project:Sandbox&action=view
print (1.18 で除去済) 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 ページを削除します

delete は既定で削除を確認するフォームを返し、利用者は理由を特定して削除を確認します。[3]

www.mediawiki.org/w/index.php?title=Project:Sandbox&action=delete
revert Reverts to a previous version of an image. The following two other parameters are required:
  • oldimage, the id of the version to revert to;
  • wpEditToken - 有効な編集トークン;
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]

以下の2つのパラメータが必要です:

  • from is the username whose edits are to be reverted
  • token はロールバック・トークンです; 以前は意図しなロールバックを未然に防いでいました(リンクをたどったり外部のサイトでボタンをクリックしたことが原因で発生)。
www.mediawiki.org/w/index.php?title=Project:Sandbox&action=rollback&from=John&token=d7aaa6c\
protect ページの保護レベルを表示または変更します:
  • By default, this script returns a form showing the current protection levels of the page, allowing the user to change the protection levels of the page.[5]
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; see Help:Patrolled edit on Meta.

rcid is the id of an edit in the recentchanges table

render Outputs the HTML rendering of the entire page content; similar to the view action, but only the unstyled article text is output, not any part of the user interface (additional toolboxes, search box, stylesheets, etc.).Note: For more stable programmatic access or to retrieve the HTML of only a piece of page content, you should use the parse API with page or pageid parameters. www.mediawiki.org/w/index.php?title=Project:Sandbox&action=render
deletetrackback (1.19 で除去済) Related to TrackBack.

This action was disabled by default in DefaultSettings.php

purgeManual:Purge ページのキャッシュをクリアし、強制的にソースのデータを用いてページの再表示を行います。
  • この action はログイン・ユーザーに対しては自動で実行されます。ログインしない場合はPOSTリクエストの要求によってのみ実行します。それ以外は purge (キャッシュを破棄) するかどうか確認を求めるメッセージを表示 (OK ボタンを押すと purge を要求して実行)。

www.mediawiki.org/w/index.php?title=Project:Sandbox&action=purge

submit ページ変更に関する様々な action を実行します (詳細下記):
  • 既定では編集ボックスを持った編集形式でページを表示します。
  • それ以外にも各種引数を使うことができます:
  1. ページを変更します
  2. ページの新版をプレビューするか、または
  3. 新版との差分を表示します(詳細は次の編集して保存の項目を参照);
www.mediawiki.org/w/index.php?title=Project:Sandbox&action=submit
edit 編集形式でページを表示、 "edit" の動作はほぼsubmitと同様 www.mediawiki.org/w/index.php?title=Project:Sandbox&action=edit
editredlink edit と同じです。[6] www.mediawiki.org/w/index.php?title=Project:Sandbox&action=editredlink
history ページの履歴を表示します。 (以下の履歴を参照) www.mediawiki.org/w/index.php?title=Project:Sandbox&action=history
historysubmit 履歴のページで「選択した版を比較」をクリックして版の差分を見ます。このとき"diff"と/または"oldid"パラメータが必要で、指定しないと現在のページを表示します。 www.mediawiki.org/w/index.php?title=Project:Sandbox&action=historysubmit&diff=456290&oldid=456270
raw ページの生の内容を表示します(See Raw, below) ポップアップ・ウインドウが開いて index.php 内のページを保存したいか否か聞いてきます。[7] www.mediawiki.org/w/index.php?title=Project:Sandbox&action=raw
ajax 有効のとき$wgAjaxExportList経由で登録された php 関数を呼出します。Manual:Ajaxを参照。[8]
creativecommons (1.19 で除去済) $wgEnableCreativeCommonsRdfを通じて既定で無効化されています。
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
dublincore (1.19 で除去済) Disabled by default via $wgEnableDublinCoreRdf
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 the Reimplement info action RfC for context.
revisiondeleteManual:Revisiondelete Set visibility restrictions on revision text, edit summary, and editor's username/IP address (requires deleterevision user right)

利用者の個人設定のオーバーライド

ここにあげるパラメータで利用者の個人設定の一部を上書きします。他の項で説明するパラメータはdiffonly、internaledit、externaleditです。次のパラメータはすべてのactionに影響するものの、renderとrawには無関係です。

名前 機能
useskin 外装を指定します 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. the user interface language; this is especially useful for creating an account, because at that stage no preference settings apply.

The special language code "qqx" can be used to display the ids of all system messages used on a page.

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 When set to yes, the page is shown in a form that is suitable for printing
debug When set to true (e.g. 1 or true), the ResourceLoader serves non-minified JavaScript and CSS. See ResourceLoader/Features#Debug mode. www.mediawiki.org/w/index.php?title=Project:Sandbox&debug=true
safemode When set to true (e.g. 1 or true), personal CSS and JS will not be loaded. www.mediawiki.org/w/index.php?title=MediaWiki&safemode=1

閲覧とレンダリング

view は既定の action です。URLに他の action が加えられなければaction=viewが使われます。単一のページや単一の変更の表示、あるいは同一もしくは別の2ページの変更前後の差分を表示します。その一覧は以下のとおり (省略版)。

diff 
the value of this parameter identifies a revision; the difference between another revision and this one is returned:
  • if oldid is not passed, the difference between this revision and the previous one on the same article is shown;
  • otherwise, the difference between the revision given by oldid/direction and this one is shown; the value of this parameter can be a revision id, the values prev or next to identify a revision relative to the one given by oldid/direction, and the value cur to identify the latest revision of the page;
Note that oldid and diff needs not to be two revisions of the same article, allowing two revisions of two different pages to be compared
redirect 
if the value of this parameter is 'no' and the page is a redirect, the page itself is shown and not the target of the redirect; this parameter has effect only on action=view and action=render and only if neither oldid nor diff is given, as this is the only case where the target article is shown instead of the redirect;
rdfrom 
when the page is the result of following a redirect from an external wiki, this parameter tells which wiki that was, so that the "Redirected from ..." line can be shown
diffonly 
override the user's preference on whether to render the page when a diff is requested, eg. diffonly=yes
search 
if non-blank (and if searches are enabled), override all other parameters and perform a search

The following parameters apply only to categories.

from 
if the page is a category, only list entries whose sortkey are equal or follows the value of this parameter;
例: https://en.wikipedia.org/w/index.php?title=Special:Log&type=upload&from=20070814233520&until=20070814233525
Links to a log of all the images uploaded on August 14, 2007 from 23:35:20 until 23:36:25
until 
if the page is a category, only list entries whose sortkey precedes the value of this parameter; only used if from is not passed;

The following parameter apply only to images.

page 
a page number in a multi-page media; it currently only applies to DjVu files; first page is numbered 1;

履歴

limit 
The number of page edits to list, the maximum is 5000 edits.
例: https://en.wikipedia.org/w/index.php?title=Special:Contributions&limit=13&contribs=user&target=Atlgirl052005 - 1 ページあたり編集 13 件を列挙します。
dir 
the relative order of edit history pages.
page edits are sorted in decreasing timestamp.
offset 
uses a timestamp to specify which part of the history is displayed;
Returns the edits which occurred before the timestamp;
例: https://en.wikipedia.org/w/index.php?title=Special:Contributions&offset=20090815195334&contribs=user&target=Atlgirl052005
Shows the edits which occurred immediately before the timestamp 20090815195334 (20090815195334 is not shown).
Parameter format is yyyymmddhhmmss. So 20090815195334 was created on August 15, 2009 [20090815] at 19:53 (UTC) and 34 seconds [195334].
See Wikipedia:Complete diff and link guide.
if dir=prev is added, it works the other way around, listing all edits after the timestamp[9]
例: https://en.wikipedia.org/w/index.php?title=Special:Contributions&dir=prev&offset=20090815195334&dir=prev&contribs=user&target=Atlgirl052005
Shows the edits which occurred immediately after the timestamp 20090815195334 (20090815195334 is not shown).
Example to show only the very first edit on a page: https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&action=history&dir=prev&limit=1
feed 
a feed for the changes in the history is returned; allowed values are atom and rss. $wgFeedManual:$wgFeed で無効化できます。
go 
(deprecated - should be avoided, because it has been superseded) go=first the first (earliest) page of history is shown

Raw

Passing action=raw returns the source code of a page or revision. For security reasons, in some versions of MediaWiki this is only allowed when using the "primary script access point", that is, when using the "ugly" URL form with index.php?title=...

templates 
if passed with value expand, templates within the page are expanded;
ctype 
the content-type value to be used in the HTTP header when returning the raw content, instead of the default text/x-wiki; this can only be one of the allowed types, which currently are text/x-wiki, text/javascript, text/css, and application/x-zope-edit
maxage 
the value of max-age in the Cache-Control HTTP header field to be used when returning the raw page (client cache)
smaxage 
the value of s-maxage in the Cache-Control HTTP header field to be used when returning the raw page (cache-server cache)
usemsgcache 
only applies to pages in the MediaWiki namespace; if this argument is present, the content of the message is returned from the message cache and not from the database
oldid 
the id of a specific revision to return
direction 
either next, prev, or cur; instead of the revision specified by oldid, returns the one following it, the one preceding it, or the current (last) one;
section 
Limits output to a particular section or subsections of the document. Sections are specified with non-negative integers : section 0 being the section before any named sections, section one being the first named section or subsection and so on. The numbering scheme treats sections and subsections as identical. A list of the sections and subsections can be obtained via API with api.php?action=parse&text={{:My_page}}__TOC__&prop=sections.

編集と投稿

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 three options produce an effect on the edit form (the first one also affects how the page is saved.)

section 
specifies the index of a section within a document to preload and edit; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value new is used to append a new section to the document;
preload 
specifies a page, of which the wikitext is used as the initial value of the textarea in the edit form if the page or section to be edited does not exist; if it exists the preload command is ignored (bug 5210 since 2006-03-09: this will preload almost the full wikitext of the source page, including the noinclude parts and tags, but not the includeonly tags.); also see Manual:Creating pages with preloaded text;
例: https://en.wikipedia.org/wiki/Talk:Main_Page?action=edit&section=new&preload=Project:Sandbox
preloadparams[] (or preloadparams%5B%5D)
Replace $1 style parameters in preload text. For example https://mediawiki.org/wiki/Project:Sandbox?action=edit&section=new&preload=Manual:Creating_pages_with_preloaded_text/param_demo&preloadparams%5b%5d=first%20value&preloadparams%5b%5d=second%20value would cause Manual:Creating pages with_preloaded text/param demo to be preloaded into the edit form, but with $1 replaced by first value and $2 replaced by second value. (1.23 で追加されました)
editintro 
title of an existing article or template to be rendered above the edit form;
preloadtitle 
in the case of section=new, provides initial content of the "Subject/headline" box; it can be edited before saving;
例: https://en.wikipedia.org/w/index.php?title=User_talk:5dsddddd&action=edit&section=new&preloadtitle=The+%5B%5BWP%3AARS%7CArticle+Rescue+Squadron%5D%5D
Example with both preloadtitle and preload: https://en.wikipedia.org/wiki/User_Talk:Ikip?action=edit&section=new&preload=Template:Article_Rescue_Squadron_ invite&preloadtitle=Invitation
nosummary 
Do not show the "headline" box when doing section=new.
summary 
its value is used as the edit summary in place of the default one.
preview 
if set to yes, overrides user preference "Show preview on first edit" (bug 9936);
internaledit/externaledit 
overrides user preference on external editors;
mode 
this parameter affects the result page if passed with value file and using an external editor;
undo 
attempts to undo an edit or a sequence of edits; technically, this is done by trying to merge the inverse of these edits with the sequence of all subsequent edits; the value of this parameter is an id of an old revision of a page; if merge is not possible, a regular edit form for that revision is returned
  • by default, undone is attempted on the edit preceeding the given revision id;
  • if undoafter is also given, the changes between the revisions undoafter and undo are attempted to be undone;

すべきこと

The following options tell the software what to do when submitting: saving, showing a preview, or showing the difference with the current version.

wpSave 
this argument is generated when saving the content of an edit form returned by the server, but is not actually used nor required when submitting (see below for required arguments to save);
wpPreview 
set in a POST request to request a preview of the page or section as if the value of wpTextbox1 were saved;
  • by default, returns an edit form with a preview of the value of wpTextbox1;
  • if the additional 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 with action=render; see Manual:Live preview for more info;
  • the argument wpLivePreview is identical to wpPreview; therefore, a regular preview is returned if live is not passed;
wpDiff 
set in a POST request to request a table showing the changes between the current version of the page or section and the version as if value of wpTextbox1 were saved;

保存する際に必要なパラメーター

The following parameters are required when a user saves a page. The edit summary field may also be required if so configured (see below).

wpTextbox1 
the new page/section content;
wpStarttime 
the timestamp of when the user started editing the page; used to check whether the page has been deleted between this moment and the submission time (in this case, the user is asked to confirm saving);
wpRecreate 
in case the page was deleted after wpStarttime, this field confirms that the page is to be saved;
wpEdittime 
for new pages, it is equal to wpStarttime; otherwise, it is the timestamp of the last revision of the page; used to check edit conflicts;
wpEditToken 
an edit token; this is used to avoid users from being tricked into saving a page by following a link or pressing a button in an external site. For non-logged-in users, wpEditToken is required since revision 18112; it currently contains only the characters +\ rather than a random string (see edit token suffix).

For the page to be saved, wpStarttime, wpEdittime, wpTextbox1 and wpEditToken are required in a POST request, and neither wpPreview nor wpDiff are passed. If the page was deleted after wpStarttime, the boolean option wpRecreate is also required.

Optional additional data

The edit summary or the "ignore blank" parameter may be mandatory if "warn on blank summaries" is configured.

wpSummary 
the edit summary;
wpMinoredit 
if set in a save request, the edit is marked as minor; for preview and diff, it is the initial value of "this is a minor edit" checkbox in the edit form;
wpWatchthis 
if passed on a save request, the page is added to the user's watchlist; if it is not passed in a save request, the page is removed from the user's watchlist; for preview or diff, this is the initial value of the "watch this page" checkbox of the edit form;
wpSection 
specify the index of a section within a document to submit to; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value new is used to append a new section to the document;
wpChangeTags 
編集に加えるための tags をコンマ区切りした任意の表 マニュアル操作のとき、それらのタグがひとつでも有効でなければ、編集は拒否されます。
wpAutoSummary 
contains the MD5-hashing of the edit summary field as initially presented to the user in the edit form; this field is used to check if the user has modified that field before submitting: if the MD5 hashing of the value of wpEditSummary is the same as this field, the edit summary has not been modified;
wpIgnoreBlankSummary 
save page even if user has not modified the edit summary, while they were supposed to;
wpTextbox2 
in case of an edit conflict, it contains the value of wpTextbox1 of the save request that generated the conflict;
safemode 
some browsers are known to have problems with editing text containing Unicode characters; when a request for an edit form come from one such browser, the non-ascii characters in the initial content of the textarea are converted into the form &#xxxx; and the value safemode=1 is hidden in the form; when submitting, the safemode field indicate that the the inverse translation is to be performed; a browser is considered non-Unicode-compliant if the User-Agent HTTP header matches a regular expressions in the variable $wgBrowserBlackList;

注 注: this has nothing to do with PHP's safe_mode setting.

wpScrolltop 
used to preserve the scrollbar position in the edit textbox when loading a preview.
redlink 
if the user does not have permission to edit the page, redirect to the empty article page (e.g., "Wikipedia does not have an article with this exact name") instead of showing the permission error notice; this parameter is used on red links.
wpExtraQueryRedirect 
hidden input to modify after save URL and is not used by actual edit form. Intended to be used by gadgets and such.

特別ページ

Most special pages have additional parameters, specific to the function they perform. As an example, the parameters for Special:Export are outlined in Parameters to Special:Export

The following URL parameters provide initial values for some input fields; they can be edited before submitting the form.

wpReason
on Special:MovePage and action=delete: text field with reason.
wpBlockReason
on Special:BlockIP: text field with reason.
wpBlockReasonList
on Special:BlockIP: initially selected item in the drop-down box, value should match a row in the MediaWiki:Ipbreason-dropdown.
mwProtect-reason
on action=protect: text field with reason.

拡張機能固有のパラメーター

FlaggedRevisionsExtension:FlaggedRevisions 拡張機能

stable
if set to 1, last stable version is shown.
stableid
like oldid except with stable image/template inclusion. Setting stableid=best will give the best version (pristine > quality > sighted > last).
filetimestamp
view the file version created at a certain date (applies only to viewing file pages)

利用者スクリプトのパラメーターと AutoEdit 拡張機能

Userspace JavaScript scripts and gadgets may interpret arbitrary parameters passed via GET or POST. If the user's or global JavaScript script include Lupin's Autoedit Script, the following parameters are used for automated editing: autoedit, autosummary, autoclick, and autominor. Some more details are given in Autoedit extension.

Maxlagパラメーター

MediaWiki バージョン: 1.10 – 1.27

The maxlag 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.

注記

  1. フォームを投稿するクライアントは、HTML 内に存在するフォーム パラメーターをすべて送信するはずです。静的なリストを当てにすることは将来の破損につながるかもしれません。 MediaWiki をインストールして新しくパラメータを登録する手順は、Hooks/UnknownActionManual:Hooks/UnknownAction をご覧ください。
  2. さらに 'view' 以外のアクションの無効化には$wgActions の変数を使います。 またさらに$wgActionsはこのたびすべてのアクションに使えるようになりました。 あるいはsearchを有効にしてsearchパラメータを補うと (空白でなくなる) その他の action を無視してsearch を実行します。
  3. Deletion is performed upon a POST request, if a valid edit token is passed as the value of wpEditToken; this is what happens when the user confirms deletion. The delete reason is passed as the value of argument wpReason; this string is recorded in the deletion log (the log_comment field of the logging table) Deletion is also performed when deleting a single version of an image; this requires the version id to be passed in the parameter oldimage and a valid edit token in wpEditToken; in this case, the request can also be passed via GET
    • if the optional summary argument is passed, its value is used as the edit summary in place of the default one
    • if the optional bot argument is passed, the edit will be marked as a bot one (the edit is marked rc_bot=1 in the recentchanges table)
    • the bot argument can also be used on any page a [rollback] link will appear on, to cascade &bot=1 to all rollback links generated
    • if the optional hidediff argument is passed, the success message is shown instead of a diff of the change (this can be forced via user preferences)
  4. These levels are changed to the values of mwProtect-level-edit and mwProtect-level-move if the request is a POST one and a valid edit token is passed as wpEditToken; parameter mwProtect-reason gives the reason for protection or unprotection which will be recorded in the page log; if mwProtect-cascade is also passed, cascading protection is applied (all transcluded pages are set to the same protection levels)
    • more generally, the actions that can be limited are those listed in the $wgRestrictionTypes array; this array is initialized to array('edit','move') and can be changed in LocalSettings.php; the protection action then accept a parameter mwProtect-level-$action for each action in that array
  5. セキュリティ上の理由でMediaWiki のバージョンによってはRawは「一次スクリプト アクセスポイント」つまりindex.php?title=...「美的でない」URL形式のときに使用が制限されます。
    • $wgUseAjaxをtrueにします。呼び出し可能な唯一の関数は$wgAjaxExportList配列内に限定($wgAjaxSearchまたは$wgAjaxWatchの設定で暗示)
    • additional parameters: rs is the function name (e.g., rs=wfSajaxSearch); the rsargs[] array is the list of arguments of this function (e.g., rsargs[]=abcd passes the abcd string to the function).
    • the JavaScript function sajax_do_call for calling Ajax functions is defined in ajax.js.
  6. For performance reasons, the value of this field is not actually an offset (the index of the first entry to show)


関連項目