我使用 VisualEditor 设置了 MediaWiki。我按照扩展的 wiki 页面,克隆 git,安装 Parsoid,添加必要的行以使 Parsoid 可以与 wiki 对话,即使它是私有的:
$local_ip = '127.0.0.1';
if ( $_SERVER['REMOTE_ADDR'] == $local_ip ) {
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = true;
}else{
# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
$wgWhitelistRead = array ("Special:Userlogin", "MediaWiki:Common.css",
"MediaWiki:Common.js", "MediaWiki:Monobook.css","MediaWiki:Monobook.js", "-");
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
}
现在我可以与 API 对话了:
$> curl -L http://localhost:8142/localhost/v3/page/html/Main_Page
<!DOCTYPE html>
<html prefix="dc: http://purl.org/dc/terms/ mw: http://mediawiki.org/rdf/" about="http://localhost/wiki/index.php/Special:Redirect/revision/1"><head prefix="mwr: http://localhost/wiki/index.php/Special:Redirect/"><meta property="mw:articleNamespace" content="0"/><link rel="dc:replaces" resource="mwr:revision/0"/><meta property="dc:modified" content="2015-09-29T22:45:43.000Z"/><meta about="mwr:user/0" property="dc:title" content="MediaWiki default"/><link rel="dc:contributor" resource="mwr:user/0"/><meta property="mw:revisionSHA1" content="8e0aa2f2a7829587801db67d0424d9b447e09867"/><meta property="dc:description" content=""/><meta property="mw:parsoidVersion" content="0"/><link rel="dc:isVersionOf" href="http://localhost/wiki/index.php/Main_Page"/><title>Main_Page</title><base href="http://localhost/wiki/index.php/"/><link rel="stylesheet" href="//localhost/wiki/load.php?modules=mediawiki.legacy.commonPrint,shared|mediawiki.skinning.elements|mediawiki.skinning.content|mediawiki.skinning.interface|skins.vector.styles|site|mediawiki.skinning.content.parsoid|ext.cite.style&only=styles&skin=vector"/></head><body data-parsoid='{"dsr":[0,592,0,0]}' lang="en" class="mw-content-ltr sitedir-ltr ltr mw-body mw-body-content mediawiki" dir="ltr"><p data-parsoid='{"dsr":[0,59,0,0]}'><strong data-parsoid='{"stx":"html","dsr":[0,59,8,9]}'>MediaWiki has been successfully installed.</strong></p>
<p data-parsoid='{"dsr":[61,171,0,0]}'>Consult the <a rel="mw:ExtLink" href="//meta.wikimedia.org/wiki/Help:Contents" data-parsoid='{"targetOff":114,"contentOffsets":[114,126],"dsr":[73,127,41,1]}'>User's Guide</a> for information on using the wiki software.</p>
<h2 data-parsoid='{"dsr":[173,194,2,2]}'> Getting started </h2>
<ul data-parsoid='{"dsr":[195,592,0,0]}'><li data-parsoid='{"dsr":[195,300,1,0]}'> <a rel="mw:ExtLink" href="//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings" data-parsoid='{"targetOff":272,"contentOffsets":[272,299],"dsr":[197,300,75,1]}'>Configuration settings list</a></li>
<li data-parsoid='{"dsr":[301,373,1,0]}'> <a rel="mw:ExtLink" href="//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ" data-parsoid='{"targetOff":359,"contentOffsets":[359,372],"dsr":[303,373,56,1]}'>MediaWiki FAQ</a></li>
<li data-parsoid='{"dsr":[374,472,1,0]}'> <a rel="mw:ExtLink" href="https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce" data-parsoid='{"targetOff":441,"contentOffsets":[441,471],"dsr":[376,472,65,1]}'>MediaWiki release mailing list</a></li>
<li data-parsoid='{"dsr":[473,592,1,0]}'> <a rel="mw:ExtLink" href="//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources" data-parsoid='{"targetOff":555,"contentOffsets":[555,591],"dsr":[475,592,80,1]}'>Localise MediaWiki for your language</a></li></ul></body></html>%
我在 Parsoid 日志中看到它起作用了
[info][localhost/Main_Page?oldid=1] redirecting to revision 1
[info][localhost/Main_Page?oldid=1] started parsing
[info][localhost/Main_Page?oldid=1] completed parsing in 364 ms
然而,当我尝试单击 wiki 页面上的“编辑”按钮时,它仍然停留在蓝色条加载状态(并且没有日志或任何输出来帮助我调试……)。
我有点困惑,有人知道下一步该做什么来检查哪里出了问题吗?我可以检查什么日志?或者你有什么想法吗?
谢谢 !