如何导入MediaWiki核PHP模块?

发布于 2025-01-19 08:23:00 字数 285 浏览 3 评论 0 原文

我想编辑和创建页面并对我想要使用的本地 wiki 进行修改。出于开发目的,我想直接与数据库交互,而不是 REST API。我在这里找到了 php 模块的文档 https://doc.wikimedia .org/mediawiki-core/master/php/md_docs_database.html。我如何导入这个模块?

I want to edit and create pages and make revisions to a local wiki that I want to play around with. For development purposes I would like to interact with the database directly rather than the REST API. I found the documentation for the php module here https://doc.wikimedia.org/mediawiki-core/master/php/md_docs_database.html. How do I import this module?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染柒℉ 2025-01-26 08:23:00

您发现没有“导入”的“模块”,它是媒体维基本身如何查询数据库的文档。它也是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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文