我安装了mediawiki并从wikipedia导入了一些xml文件,但只导入了文本,我还需要导入图像..
我在 stackoverflow 上搜索了解决方案,并在互联网上四处寻找,但没有成功。 有什么帮助吗?
谢谢..
无需导入图像即可使其在您的 wiki 中可见。由于维基百科的大部分图像都由 WikiMedia Commons 托管,因此启用 InstantCommons:
$wgUseInstantCommons = true;
就足以使图像出现在您的 Wiki 页面上,就像它们已上传到您的服务器一样。
如果有图像上传到维基百科本身,而不是 Commons,您可以将其存储库添加为 foreign repo,例如:
$wgForeignFileRepos[] = [
'class' => ForeignAPIRepo::class,
'name' => 'enwikipedia',
'apibase' => 'https://en.wikipedia.org/w/api.php',
'hashLevels' => 2,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
];