Manual:resetPageRandom.php
Appearance
| MediaWiki ファイル: resetPageRandom.php | |
|---|---|
| 場所: | maintenance/ |
| ソース コード: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| クラス: | ResetPageRandom |
詳細
resetPageRandom.php maintenance script resets the page_random field for articles in the provided time range.
The page_random field in the page table is responsible for returning random pages.
This is useful when you want to refresh your random article sequence.
オプション
| オプション | Description | 必須かどうか | 既定値 |
|---|---|---|---|
| --from | From date range selector to select articles to update, e.g. 20041011000000 | 必須 | |
| --to | To date range selector to select articles to update, e.g. 20050708000000 | 必須 | |
| --dry | Do not update column. Just do dry run. | 省略可能 | null
|
| --batch-start | Use when you need to restart the reset process from a given page ID offset in case a previous reset failed or was stopped | 省略可能 | 0
|
使用法
php maintenance/run.php resetPageRandom --from fromDate --to toDate [ --dry | --batch-start ]
MediaWiki バージョン 1.39.15 以前では、メンテナンス スクリプトを
php maintenance/run.php スクリプト名 ではなく php maintenance/スクリプト名.php を使用して実行する必要があります。Dry run to test
Terminal
$ php maintenance/run.php resetPageRandom --from 20210901000000 --to 20211018000000 --dry Resetting page_random column within date range from 20210901000000 to 20211018000000. dry run ...doing chunk of 200 from 0 ...doing chunk of 200 from 207 page_random reset complete ... changed 206 rows
Actual run to update the column
Terminal
$ php maintenance/run.php resetPageRandom --from 20210901000000 --to 20211018000000 Resetting page_random column within date range from 20210901000000 to 20211018000000. ...doing chunk of 200 from 0 ...doing chunk of 200 from 207 page_random reset complete ... changed 206 rows