Modelo: Ficheiro MW
| Ficheiro do MediaWiki: {{{1}}} | |
|---|---|
| Localização: | / |
| Código fonte: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | Encontrar código • Encontrar documentação |
| 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. |
Exibe uma caixa informativa sobre um ficheiro no núcleo do MediaWiki, com hiperligações para o seu código fonte em ramificações principal, estável e legado, e hiperligações para as suas classes e interfaces na documentação PHP gerada.
{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
- FILENAME é o nome do ficheiro, incluindo a extensão.
- Se o ficheiro foi renomeado recentemente, pode utilizar os parâmetros
stable=elegacy=para fornecer o nome antigo para que as hiperligações funcionem; você terá de atualizar a invocação do modelo conforme a versão na qual o ficheiro foi renomeado é movido de master->stable->legacy.
- Se o ficheiro foi renomeado recentemente, pode utilizar os parâmetros
- PATH é o caminho do ficheiro; não inclui uma barra oblíqua, inclui uma barra oblíqua final. Deixe em branco para os ficheiros da diretoria raiz.
- Os argumentos
classsão todos opcionais, e se fornecidos irão interligar com a documentação gerada. CLASS deveria ser o nome da classe, como utilizado no URL. Por exemplo, "Parser" geraria uma hiperligação para "classParser.html". O modelo permite até seis parâmetros de classe,class1-class6 - INTERFACE é similar. O modelo permite até 3 parâmetros de interface
- O argumento
NotInGité opcional e só deveria ser utilizado se o ficheiro não está no Git por qualquer motivo (eu acho que isto só afeta aLocalSettings.php). REASON é a razão que é exibida na caixa de informação. Note queNotInGité sensível a maiúsculas e minúsculas!
O Manual utiliza este modelo extensivamente.
Exemplos
{{MW file|index.php|}}
| Ficheiro do MediaWiki: index.php | |
|---|---|
| Localização: | |
| Código fonte: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | Encontrar código • Encontrar documentação |
{{MW file|Article.php|includes/page/
|class1=MediaWiki\Page\Article
}}
| Ficheiro do MediaWiki: Article.php | |
|---|---|
| Localização: | includes/page/ (includes/Page/ na versão 1.46 ou superior) |
| Código fonte: | 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
}}
| Ficheiro do MediaWiki: WikiPage.php | |
|---|---|
| Localização: | includes/page/ (includes/Page/ na versão 1.46 ou superior) |
| Código fonte: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | MediaWiki\Page\WikiPage • MediaWiki\Page\Page |
{{MW file|LocalSettings.php|
|NotInGit=criado durante a instalação
}}
| Ficheiro do MediaWiki: LocalSettings.php | |
|---|---|
| Localização: | |
| Código fonte: | não está no Git (criado durante a instalação) |
| 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
}}
| Ficheiro do MediaWiki: includes/Title/Title.php | |
|---|---|
| Código fonte: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | MediaWiki\Title\Title |
Consultar também
- {{Git file}} – uma hiperligação simples para um ficheiro no gerrit (de mediawiki/core ou outro)
- Categoria: Páginas de código do MediaWiki sem os nomes de classe – as páginas preenchidas de forma incompleta são listadas automaticamente por este modelo
- 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 |