如何导入MediaWiki核PHP模块?
我想编辑和创建页面并对我想要使用的本地 wiki 进行修改。出于开发目的,我想直接与数据库交互,而不是 REST API。我在这里找到了 php 模块的文档 https://doc.wikimedia .org/mediawiki-core/master/php/md_docs_database.html。我如何导入这个模块?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您发现没有“导入”的“模块”,它是媒体维基本身如何查询数据库的文档。它也是15年前的日期,因此很有可能再准确了。
除了将前缀添加到名称外,如果安装配置为使用一个,则描述的功能只需构建您告诉它们的任何SQL,因此即使您使用了它们,您仍然需要了解可以使用哪些表。到那时,将您舒适的任何应用程序或库直接用于数据库并运行直接SQL可能会更容易。
要了解数据库的布局,您可以在此处查看手册:
您的另一个选项是。然后,您可以访问MediaWiki代码本身使用的各种辅助对象和方法,而不仅仅是API暴露的方法。
What you have found there is not a "module" to "import", it is documentation of how MediaWiki itself queries the database. It's also dated 15 years ago, so there's a fair chance it's not even accurate any more.
Other than adding a prefix to names if the installation is configured to use one, the functions described just build whatever SQL you tell them to, so even if you used them, you'd still need to understand which tables to work with. At that point, it will probably be easier to use whatever application or library you're comfortable with to context directly to the database and run direct SQL.
To find out the layout of the database, you can look in the manual here: https://m.mediawiki.org/wiki/Manual:Database_layout
Your other option would be to write your code as a MediaWiki extension. Then you'd have access to the various helper objects and methods used by the MediaWiki code itself, rather than only those exposed by the API.