Jump to content

Manual:PageExists.php/zh

From mediawiki.org
This page is a translated version of the page Manual:PageExists.php and the translation is 7% complete.
MediaWiki版本:
1.24
Gerrit change 132695

Details

pageExists.php file is a maintenance script to report whether a page with a specific title exists. It will print out the result to standard output with a meaningful text, and will set the exit status of the script to 0 if the page exists.

This script is very useful for bash and other scripting languages where we need to work with exit status code.

Options/Arguments

Argument Description Required?
<Page title> Page title to be checked Required


Usage

php maintenance/run.php pageExists "page title"
Terminal
在MediaWiki 1.43.6 及更早版本中,您必须通过php maintenance/脚本名称.php调用维护脚本,而不是php maintenance/run.php 脚本名称

重复退出状态示例:

Terminal

Exit status 0 means the page exists. Exit status 1 means the page does NOT exist.

See also