Manual:$IP

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$IP and the translation is 40% complete.
Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Nederlands • ‎Türkçe • ‎español • ‎français • ‎lietuvių • ‎magyar • ‎português • ‎português do Brasil • ‎čeština • ‎русский • ‎ไทย • ‎中文 • ‎日本語 • ‎粵語
Server URLs and file paths: $IP
Jalur lengkap ke direktori instalasi.
Introduced in version:pre 1.1.0
Removed in version:still in use
Allowed values:(String yang berisi jalur absolut.)
Default value:Variabel lingkungn MW_INSTALL_PATH, atau jika tidak disetel, direktori kerja saat ini

Pengaturan variabel ini secara manual ke jalur absolut ke MediaWiki pada disk dari LocalSettings.php diperlukan dalam versi MediaWiki yang lebih lama. 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.

Detail

IP stands for Install Path. The variable holds the local file path to the base installation of your wiki. If for whatever reason you want to overwrite its default - make sure you refer to the fully qualified file path. Do not include a slash at the end of the path.

In MediaWiki 1.16 and prior, where the DefaultSettings.php file still had to be loaded from inside LocalSettings.php, the directory to load it from was determined by the IP variable.

Unlike other variables, the default is set in WebStart.php instead of in DefaultSettings.php.

Setting the MW_INSTALL_PATH environmental variable can sometimes be useful when running maintenance scripts that are in non-standard directories. (Maintenance scripts by default use the parent of the current working directory as $IP).