gpt4 book ai didi

php - 为什么是 "Max made me put this here"?

转载 作者:太空狗 更新时间:2023-10-29 14:01:56 25 4
gpt4 key购买 nike

每个 MediaWiki 都有一个 load.php .

如果不带参数调用它返回:

/* No modules requested. Max made me put this here */

作为一个好奇的程序员,我想知道:

他为什么要这样做?

我确信在像这样的大项目中有一个很好的理由。在我看来,将空文件返回给 ajax 查询或类似的东西是不好的。

顺便说一句:通常它是用这样的参数调用的:load.php?debug=true&lang=de&modules=user.options&only=scripts&skin=modern&user=pi&*

最佳答案

此消息来自 ResourceLoader.php。在 the history文件,使用 git blame ,您可以看到代码是由 Roan Kattouw (RK) 在 this changeset 中编写的.来自变更集评论:

Make load.php output a comment explaining what's going on when no modules were requested rather than outputting nothing. Max made me do this because he hates blank pages

所以,你的答案是,因为 Max 讨厌空白页,如果你想知道更多,你应该问 Roan。我的猜测是它是一种调试辅助工具;而不是盯着空白页想知道为什么它是空白的,至少你知道你做了一些导致模块加载器请求加载任何东西的事情......

正如@svick 指出的那样,还有一个指向 code review 的链接。 ,包括讨论提及 Max 是否是个好主意。提及 Max 被视为可能部分关闭 MediaWiki bug 20281 ,它指出没有足够的 Easter Eggs在 MediaWiki 中。

这就是开源软件的公共(public)存储库很酷的原因 :D

关于php - 为什么是 "Max made me put this here"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19770275/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com