Podręcznik:Edit.php
| Plik MediaWiki: edit.php | |
|---|---|
| Lokalizacja: | maintenance/ |
| Kod źródłowy: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Klasy: | EditCLI |
Szczegóły
edit.php to skrypt do zmiany treści artykułów z poziomu wiersza poleceń.
Użycie
php edit.php [options...] <title>
Opcje
| Opcja/Parametr | Opis |
|---|---|
-u <user> |
Nazwa użytkownika |
-s <summary> |
Opis zmian |
| -m | Drobna zmiana |
| -b | Edycja bota |
| -a | Włącz automatyczne wstawianie opisów zmian |
| --no-rc | Nie pokazuj zmiany na ostatnich zmianach |
Jeżeli określony użytkownik nie istnieje, zostanie utworzony. Jeżeli nie zostanie podana nazwa użytkownika, edycja zostanie przypisana użytkownikowi o nazwie "Maintenance script" (takowy zostanie utworzony jeżeli potrzeba). Treść zmiany zostanie odczytana z wejścia standardowego (stdin).
Przykłady
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.
You can do many complex text transformations of page text this way; see your unix manual's entry for sed.