Manual:Update.php/pt
ficheiro do MediaWiki: update.php | |
---|---|
Localização: | maintenance/ |
Código fonte: | master • 1.44.0 • 1.43.3 • 1.39.13 |
Classes: | UpdateMediaWiki |
Detalhes
update.php verifica se o esquema da base de dados do MediaWiki precisa de ser atualizada para poder funcionar com a versão atual do MediaWiki.
Deveria executar update.php
depois de cada atualização do MediaWiki ou depois de atualizar ou instalar uma extensão que requer uma atualização de esquema.
A maioria das extensões que requerem atualizações de esquema irão informar na própria documentação.
$wgAllowSchemaUpdates
. People with extremely large and busy wikis may need to do upgrades with care, but if you're not sure if that applies to you, then it probably doesn't.Usage
No navegador
Se não tem acesso à linha de comandos do seu servidor, então, utilize o atualizador da Web para executar o comando de atualização.
Na linha de comandos
Na linha de comandos, ou numa interface de SHH ou similar:
Versão MediaWiki: | ≥ 1.40 |
$ php maintenance/run.php update
Versão MediaWiki: | ≤ 1.39 |
$ php maintenance/update.php
Use the following on Vagrant instances (from within your Vagrant SSH).
$ mwscript update.php
Parâmetros
Este comando oferece vários parâmetros (genérico, dependente e específico do comando) que pode ser necessário em alguns ambientes wiki.
Parâmetros de manutenção genéricos
--help
- used to get a prompt of all available script parameters (generic, script dependent, and script specific) together with short explanations of their usage. These are less often used parameters.
--wiki wikiId
- update wiki family if database name depends on a virtual host, where wikiId - database name (e.g., enwiki, dewiki ...)
--conf
- Specifies the config file (the
LocalSettings.php
file for the specific wiki). Utilizado para as famílias wiki.
Parâmetros específicos de comando
--quick
- skip countdown sequence
--initial
- (introduzido(a) na 1.43) Do initial updates required after manual installation using tables-generated.sql
--doshared
- Update shared tables as well.
--noschema
- All changes to the table structure or table additions are skipped. Only data changes are made.
--schema
- No schema changes are made to the database, but the schema changes are saved to a separate SQL file that can be run.
- Allows "update.php" to be run when $wgAllowSchemaUpdates is set to false. This is useful for non-WMF environments where strict DB permissions allow database updates (which "update.php" performs), but no schema changes (such as adding or dropping tables or indexes, which "update.php" also performs).
--force
- Run this script even if configuration options disable it.
--skip-external-dependencies
- when using composer.local.json to let Composer install extensions and their dependencies, you may see an error message saying that there is a mismatch between the installed and required version (e.g. "mediawiki/semantic-breadcrumb-links: 1.3.0 installed, ~1.3 required"). You can use this parameter to ignore the message and run update.php regardless.
--skip-config-validation
- (introduzido(a) na 1.39) Skips checking whether the existing configuration is valid. Otherwise, this script will not run if an invalid configuration is detected.
--skip-compat-checks
- (removed in 1.41) Ignora verificações de compatibilidade (Gerrit change 851684)
--nopurge
- (removed in 1.36) do not purge objectcache table. Normally
update.php
purges the objectcache table (generally contains the parser cache and the messages cache), msg_resource and msg_resource_links (these are used for ResourceLoader message caching and are cleared in 1.21 and later) tables in the database, if you don't want to purge this table, use the--nopurge
option.
Ver também
- Manual:$wgDBadminuser e Manual:$wgDBadminpassword
- para instruções detalhadas em como utilizar $update, consulte $updating, $cmd
- For detailed instruction on using
update.php
, see Manual:Atualização , Manual:Upgrading#Command_line