Manual:$IP

From mediawiki.org
This page is a translated version of the page Manual:$IP and the translation is 60% complete.
Server URLs and file paths: $IP
O caminho completo para a diretoria de instalação.
Introduzida na versão:pre 1.1.0
Removida na versão:ainda em uso
Valores permitidos:(String com um caminho absoluto.)
Valor por omissão:A variável de ambiente MW_INSTALL_PATH, ou se não definida, a diretoria de trabalho atual

Manually setting this variable to the absolute path to MediaWiki on disk from LocalSettings.php was necessary in older versions of MediaWiki. However, at least since MediaWiki 1.18, manually defining $IP in LocalSettings.php is no longer needed and no longer works as you may expect. It will default to the current working directory and it can be used without the need to define it manually.

If you have to override the default value you have to declare the environment variable MW_INSTALL_PATH. See the documentation of your webserver for how to do it.

Note that you can't just override $IP from your LocalSettings.php if you do not want to fix also all the variables that are based on it, like $wgExtensionDirectory etc.

Detalhes

IP significa Caminho Instalação. A variável contém o caminho do ficheiro local para a instalação base do seu wiki. Se, por algum motivo, deseja substituir a predefinição - certifique-se que refere o caminho do ficheiro totalmente qualificado. Não inclua uma barra no final do caminho.

No MediaWiki 1.16 e anterior, onde o ficheiro DefaultSettings.php ainda precisava de ser carregado de dentro de LocalSettings.php, a diretoria fonte era determinada pela variável IP.

Ao contrário das outras variáveis, a predefinição é definida no Webstart.php em vez do Defaultsettings.php.

Definir a variável de ambiente MW_INSTALL_PATH, ás vezes pode ser útil quando executar "scripts" de manutenção que são diretorias não padrão. (Os "scripts" de manutenção por predefinição utilizam a fonte da diretoria de trabalho atual como $IP).