如何通过脚本创建、阅读、更新和删除 Mediawiki 文章?
目前我正在尝试找出在 wiki 页面上执行 CRUD 操作的最简单方法(使用 PHP)。
我构建了一个媒体维基扩展,可以上传文件并解析其内容。根据内容,有必要创建或更新相应的 wiki 文章。
问题是是否已经有一些我可以使用的不错的实现(或最佳实践),或者我是否必须从头开始使用 wiki api。
Currently I'm trying to figure out what's the easiest way to perform CRUD operations on wiki pages (using PHP).
I've built an media wiki extension where it's possible to upload a file and parse its content. Depending on the content it is necessary to either create or update the respective wiki articles.
The question is if there are already some nice implementations (or best practices) which I might use or if I have to start from scratch with the wiki api.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,这比预期容易得多。只需创建一个 Article 对象并使用
doEdit
函数来创建或编辑页面:$mode 为
EDIT_NEW
或EDIT_UPDATE
。很抱歉迟到的答复,但是我不能在 8 小时内回答我自己的问题。
Ok, this was a lot easier than expected. Just create an Article object and use the
doEdit
function to create or edit a page:And $mode is either
EDIT_NEW
orEDIT_UPDATE
.Sorry for the delayed answer, however I wasn't allowed to answer my own questions within 8 hours.