Jump to content

手册:run.php

From mediawiki.org
This page is a translated version of the page Manual:Run.php and the translation is 48% complete.

细节

run.php file is the entry point introduced in 工單T99268 for running maintenance scripts. The executable maintenance/run will call it. Since MediaWiki 1.40, running a maintenance script without run.php is deprecated. It introduces the wfMaintenanceRunSetup callback.

用法

./maintenance/run <script>

‎<script> - The name of the maintenance script to run. Can be given as a class name or file path. .php后缀是可选的。 Paths starting with ./ or ../ are interpreted to be relative to the current working directory. Other relative paths are interpreted relative to the maintenance script directory. Dots (.) are supported as namespace separators in class names. An extension name may be provided as a prefix, followed by a colon, e.g. MyExtension:exampleScript, to indicate that the path or class name should be interpreted relative to the extension.

高级用法

./maintenance/run [--conf|--globals|--memory-limit|--profiler|--server|--wiki] <script>

通用维护参数

选项/参数 描述
--conf “LocalSettings.php”的位置,如果不是默认值。
--globals 处理结束时输出全局变量以进行调试
--memory-limit 为脚本设置一个特定的内存限制,“max”表示无限制,或“default”以避免更改它
--profiler The output format of the profiler, usually "text".
--server The protocol and server name to use in URLs, e.g. https://en.wikipedia.org. This is sometimes necessary because server name detection may fail in command line scripts.
--wiki For specifying the wiki ID

参见