Manual:attachLatest.php
Appearance
From mediawiki.org
This page is a translated version of the page Manual:AttachLatest.php and the translation is 32% complete.
Outdated translations are marked like this.
Versão do MediaWiki:
≥ 1.6
| Arquivo do MediaWiki: attachLatest.php | |
|---|---|
| Localização: | maintenance/ |
| Código-fonte: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| Classes: | AttachLatest |
Detalhes
attachLatest.php file is a maintenance script that fixes incorrect values in the page_latest field in the database.
The program is looking for pages with column page_latest from the table page set to 0.
For these pages, it then attaches the latest revision of that page according to the revision timestamp.
The script finally prints out the number of pages, which have been or would be changed.
attachLatest.php does not check, if the revision, which is set as
page_latest actually exists. If the page_latest field points to a non-existing revision, attachLatest.php, unless used with the --regenerate-all parameter, will not fix this.Options/Arguments
| Opção/Parâmetro | Descrição | Required? |
|---|---|---|
| --fix | Para realmente mudar o banco de dados. | Optional |
| --regenerate-all | Para regenerar este campo para todos os registros na página de tabela. | Optional |
Será exibido o que será corrigido, mas nenhuma alteração será feita no banco de dados.
Uso
phpmaintenance/run.phpattachLatest[--fix|--regenerate-all]
No MediaWiki versão 1.39.15 e anteriores, você deve invocar os scripts de manutenção usando
php maintenance/scriptName.php em vez de php maintenance/run.php scriptName.Dry run to check pages
Terminal
$ php maintenance/run.php attachLatest Looking for pages with page_latest set to 0... Done! Processed 13 pages. This was a dry run; rerun with --fix to update page_latest.
Fixing the pages
Terminal
$ php maintenance/run.php attachLatest --fix Looking for pages with page_latest set to 0... Done! Processed 13 pages.