Manual:Edit.php
ficheiro do MediaWiki: edit.php | |
---|---|
Localização: | maintenance/ |
Código fonte: | master • 1.43.0 • 1.42.4 • 1.39.11 |
Classes: | EditCLI |
Detalhes
O ficheiro edit.php é um script de manutenção para editar um artigo a partir da linha de comando.
Uso
php edit.php [options...] <title>
Opções
Opção/parâmetro | Descrição |
---|---|
-u <user> |
Nome de Utilizador |
-s <summary> |
Editar resumo da edição |
-m | Edição menor |
-b | Edição de bot (escondida) |
-a | Habilitar autosumário |
--no-rc | Não exibe a alteração nas mudanças recentes |
If the specified user does not exist, it will be created. If no username has been provided, the edit will be attributed to user "Maintenance script", created if needed. The text for the edit will be read from stdin.
Exemplos
php edit.php -s "Quick edit" -m Page_I_want_to_edit < file_containing_wikitext
The above will edit the page Page_I_want_to_edit
(marking the edit minor) so it contains the contents of the file file_containing_wikitext using the edit summary Quick edit.
php getText.php "page_title" | sed -e 's/\bfoo\b/bar/g' | php edit.php "page_title"
The above will take the text of the page page_title
from your wiki, replace every occurrence of the word foo with the word bar, and save the result back to the page page_title
.
Pode fazer muitas transformações de texto complexas do texto da página dessa maneira; veja a entrada do seu manual Unix para sed.