Template:MW file
| MediaWiki-Datei: {{{1}}} | |
|---|---|
| Speicherort: | / |
| Quellcode: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| Klassen: | Code finden • Dokumentation finden |
| Diese Vorlage wird auf ungefähr 6,500+ Seiten verwendet. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in its /sandbox or /testcases subpages or in your own user subpage. The tested changes can then be added to this page in one single edit. Please consider discussing any changes on the talk page before implementing them. |
Displays an informative box about a file in MediaWiki core, with links to its source code in master, stable, and legacy branches, and links to its classes and interfaces in the generated PHP documentation.
{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
- FILENAME ist der Name der Datei, einschließlich der Erweiterung.
- Wenn die Datei kürzlich umbenannt wurde, können Sie die Parameter
stable=undlegacy=verwenden, um den alten Namen anzugeben, damit Verknüpfungen funktionieren. Sie müssen den Vorlagenaufruf aktualisieren, wenn die Version, in der die Datei umbenannt wurde, von master->stable->legacy verschoben wird.
- Wenn die Datei kürzlich umbenannt wurde, können Sie die Parameter
- PATH ist der Pfad zu der Datei; beziehen Sie keinen Schrägstrich ein, beziehen Sie den schleifenden Schrägstrich ein. Lassen Sie es leer für Dateien im Stammverzeichnis.
- Die
class-Argumente sind alle optional und werden, falls angegeben, mit der generierten Dokumentation verknüpft. CLASS sollte der Name der Klasse sein, wie in der URL verwendet. z.B. würde "Parser" einen Link zu "classParser.html" generieren. The template allows up to six class parameters,class1-class6 - INTERFACE ist ähnlich. The template allows up to three interface parameters
- Das
NotInGitArgument ist optional und sollte nur verwendet werden, wenn die Datei aus irgendeinem Grund nicht im Git ist (angenommen es gilt nur für die DateiLocalSettings.php). REASON ist der Grund der in der Infobox angezeigt wird. Beachten Sie, dassNotInGitempfindlich ist!
Das Handbuch:Inhalt benutzt diese Vorlage häufig.
Beispiele
{{MW file|index.php|}}
| MediaWiki-Datei: index.php | |
|---|---|
| Speicherort: | |
| Quellcode: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| Klassen: | Code finden • Dokumentation finden |
{{MW file|Article.php|includes/page/
|class1=Article
}}
| MediaWiki-Datei: Article.php | |
|---|---|
| Speicherort: | includes/page/ (includes/Page/ in 1.46 or later) |
| Quellcode: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| Klassen: | Article |
{{MW file|WikiPage.php|includes/page/
|class1=WikiPage
|interface1=Page
}}
| MediaWiki-Datei: WikiPage.php | |
|---|---|
| Speicherort: | includes/page/ (includes/Page/ in 1.46 or later) |
| Quellcode: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| Klassen: | WikiPage • Page |
{{MW file|LocalSettings.php|
|NotInGit=während Installation erstellt
}}
| MediaWiki-Datei: LocalSettings.php | |
|---|---|
| Speicherort: | |
| Quellcode: | nicht in Git (während Installation erstellt) |
| Klassen: | |
Siehe auch
- {{Git file}} — a simple link to a file on gerrit (from mediawiki/core or otherwise)
- Kategorie:MediaWiki-Codeseiten ohne Klassennamen — incompletely filled pages are automatically listed by this template
- Category:MediaWiki code pages without namespaces — File pages without a namespace declared are automatically added here. They should probably have a namespace.
Displays an informative box about a file in MediaWiki core, with links to its source code in master, stable, and legacy branches, and links to its classes and interfaces in the generated PHP documentation.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| File name | 1 | Name of the file, including extension. If the file has been recently renamed, you can use the stable= and the legacy= parameters to provide the old name so links work; you'll need to update the template invocation as the release in which the file was renamed moves from master → stable → legacy.
| String | required |
| File path | 2 | Path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory.
| String | required |
| Not in Git? | NotInGit | Whether the version is in Git version control (only rarely used for files like LocalSettings.php and DevelopmentSettings.php). Optional and should only be used if the file is not in Git for some reason. Reason= is the reason that is displayed in the infobox. Note that NotInGit is CASE-SENSITIVE.
| String | optional |
| Stable MediaWiki version | stable | no description | Unknown | optional |
| Legacy MediaWiki version | legacy | no description | Unknown | optional |
| LTS MediaWiki Version | lts | Long-Term Support version for MediaWiki | Unknown | optional |
| Class 1 | class1 | Class arguments are all optional, and if supplied will link to the generated documentation. Class should be the class name, as used in the URL. The template allows up to six class parameters
| String | suggested |
| Class 2 | class2 | no description | Unknown | optional |
| Class 3 | class3 | no description | Unknown | optional |
| Class 4 | class4 | no description | Unknown | optional |
| Class 5 | class5 | no description | Unknown | optional |
| Class 6 | class6 | no description | Unknown | optional |
| Interface 1 | interface1 | Similar to Class. The template allows up to three interface parameters. | Unknown | suggested |
| Interface 2 | interface2 | no description | Unknown | optional |
| Interface 3 | interface3 | no description | Unknown | optional |
| Example | example | no description | Unknown | optional |
| nodisplaytitle | nodisplaytitle | no description | Unknown | optional |