Manual:importTextFiles.php
MediaWiki file: importTextFiles.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.39.1 • 1.38.5 • 1.35.9 |
Classes: | ImportTextFiles |
詳細
importTextFiles.php file is a maintenance script that imports text files to pages on the wiki, optionally preserving the file timestamp. The file name (without extension) is used as the page title, optionally preceded by a given prefix.
使用法
php importTextFiles.php [options...] <file> [<file>...]
オプション
オプション/パラメーター | 説明 |
---|---|
-u <利用者> | 編集を帰属させる利用者名です。 指定した利用者が存在しない場合は、作成されます。 利用者名を指定しなかった場合は、編集は利用者「Maintenance script」に帰属し、必要であれば作成もされます。 |
-s <要約> | 編集の要約です。 要約を指定しなかった場合は、「Imported from text file」が使用されます。 |
--rc | 編集を最近の更新に表示します。 By default, this option is not set so that the edits are not shown in the recent changes. |
--bot | In the recent changes, mark the edits as "Bot edits" (only relevant if --rc is passed as well). 既定では、このオプションは設定されません。 |
--prefix <接頭辞> | ページ名は既定ではファイル名から拡張子を除いたものになります。 これで接頭辞を指定した場合は、ページ名はこの接頭辞を付加したものになります。 接頭辞はページ名を作成する際にファイル名の前に付加される文字列です。 |
--use-timestamp | テキスト ファイルの最終更新日時を、編集のタイムスタンプとして使用します。 By default, --use-timestamp is not set; in this case, the current timestamp of the moment of the import of the text file is used. |
--overwrite | 既存のページに上書きします。 既定値は false であるため、既存のページはスキップされます。 If --use-timestamp is passed as well, --overwrite will only overwrite pages if the file has been modified since the page was last modified – in other words, if, according to their modification timestamps, the file is newer than the page. |
例
php importTextFiles.php -s "Updating weather observations" --prefix "Template:Latest meteo/" --overwrite --use-timestamp meteo-*.txt
このコマンドでは、カレント ディレクトリ内でワイルドカード meteo-*.txt
に合致するファイルが、Template:Latest meteo/
で始まる名前のページに取り込まれます。
例えば、meteo-Sydney.txt
はページ Template:Latest meteo/meteo-Sydney
に取り込まれます。
ファイルの最終更新日時が、版のタイムスタンプとして使用されます。
既存のページは上書きされます。
Regressions
importTextFiles.php is broken on MediaWiki 1.35.0. Use MediaWiki 1.35.1 or higher.