Manual:$wgUseInstantCommons/ru

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgUseInstantCommons and the translation is 18% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎Nederlands • ‎català • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎suomi • ‎русский • ‎中文 • ‎日本語
Shared uploads: $wgUseInstantCommons
Включить InstantCommons, то есть использовать Викисклада в качестве общего репозитория
Появилось, начиная с версии:1.16.0 (r58652)
Удалено в версии:все еще используется
Допустимые значения:(boolean)
Значение по умолчанию:false
Другие настройки: По алфавиту | По функциональности

Использование

Добавьте в свой LocalSettings.php :

$wgUseInstantCommons = true;

Детали

Setting this configuration parameter to true enables InstantCommons, which allows to automatically use in the local wiki images hosted in Wikimedia Commons.

This configuration parameter's setting is a shorthand for the following setting to $wgForeignFileRepos :

$wgForeignFileRepos[] = [
	'class' => 'ForeignAPIRepo',
	'name' => 'wikimediacommons',
	'apibase' => 'https://commons.wikimedia.org/w/api.php',
	'url' => 'https://upload.wikimedia.org/wikipedia/commons',
	'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
	'hashLevels' => 2,
	'transformVia404' => true,
	'fetchDescription' => true,
	'descriptionCacheExpiry' => 43200,
	'apiThumbCacheExpiry' => 0,
];

Note

Enabling this configuration parameter does not avoid any usage of disk space on the server running the local wiki. Until MediaWiki 1.26, this setting did indeed generate thumbs on the local disk for caching purposes. In case the dimensions of the original file on Wikimedia Commons are exceeded when embedding the file on a page in the local wiki, the file will in its original size be put onto the local disk.

Since MediaWiki 1.27, $wgUseInstantCommons hotlinks images from Commons by default instead of downloading originals and thumbnailing them locally. This allows wikis to save on CPU and bandwidth while reducing time to first byte for pages, even without a thumbnail handler. See the documentation of configuration parameter $wgForeignFileRepos for tweaks.

See also