Template:MW file
| Fitxer de MediaWiki: {{{1}}} | |
|---|---|
| Ubicació: | / |
| Codi font: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | Codi • Documentació |
| This template is used on approximately 6,500+ pages. 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. |
Mostra un quadre informatiu sobre un fitxer del nucli de MediaWiki, amb enllaços cap al codi font a les branques master, stable i legacy, i enllaços cap a les classes i interfícies a la documentació PHP generada.
{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
- FILENAME és el nom del fitxer, inclosa l'extensió.
- Si el fitxer s'ha reanomenat recentment, podeu emprar els paràmetres
stable=ilegacy=per proporcionar el nom antic perquè els enllaços funcionin; us caldrà actualitzar la invocació de plantilla a mesura que la versió en què es va reanomenar el fitxer vagi de master a stable i d'aquí a legacy.
- Si el fitxer s'ha reanomenat recentment, podeu emprar els paràmetres
- PATH és el camí del fitxer; no hi inclogueu una barra al davant, però sí al darrere. Deixeu-ho en blanc per a fitxers del directori arrel.
- Tots els arguments de
classsón opcionals, i si es subministren enllaçaran amb la documentació generada. CLASS ha de ser el nom de la classe, tal com s'utilitza a l'URL. Per exemple, "Parser" generaria un enllaç cap a "classParser.html". La plantilla permet fins a sis paràmetres de classe,class1-class6 - INTERFACE és similar. La plantilla permet fins a tres paràmetres d'interfície
- L'argument
NotInGités opcional i només hauria d'emprar-se si el fitxer no és a Git per qualsevol motiu (crec que això només afecta aLocalSettings.php). REASON és la raó que es mostra a la infotaula. Penseu queNotInGités sensible a caixa (majúscules/minúscules)!
El Manual utilitza aquesta plantilla abastament.
Exemples
{{MW file|index.php|}}
| Fitxer de MediaWiki: index.php | |
|---|---|
| Ubicació: | |
| Codi font: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | Codi • Documentació |
{{MW file|Article.php|includes/page/
|class1=MediaWiki\Page\Article
}}
| Fitxer de MediaWiki: Article.php | |
|---|---|
| Ubicació: | includes/page/ (includes/Page/ in 1.46 or later) |
| Codi font: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | MediaWiki\Page\Article |
{{MW file|WikiPage.php|includes/page/
|class1=MediaWiki\Page\WikiPage
|interface1=MediaWiki\Page\Page
}}
| Fitxer de MediaWiki: WikiPage.php | |
|---|---|
| Ubicació: | includes/page/ (includes/Page/ in 1.46 or later) |
| Codi font: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | MediaWiki\Page\WikiPage • MediaWiki\Page\Page |
{{MW file|LocalSettings.php|
|NotInGit=creat durant la instal·lació
}}
| Fitxer de MediaWiki: LocalSettings.php | |
|---|---|
| Ubicació: | |
| Codi font: | no és a Git (creat durant la instal·lació) |
| Classes: | |
{{MW file|includes/Title/Title.php
|stable=includes/title/Title.php
|legacy=includes/title/Title.php
|lts=includes/Title.php
|class1=MediaWiki\Title\Title
}}
| Fitxer de MediaWiki: includes/Title/Title.php | |
|---|---|
| Codi font: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | MediaWiki\Title\Title |
Vegeu també
- {{Git file}} – a simple link to a file on gerrit (from mediawiki/core or otherwise)
- Category:MediaWiki code pages without class names – aquesta plantilla llista automàticament les pàgines emplenades parcialment
- 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 |