Manual:pageExists.php

From Linux Web Expert

Revision as of 17:19, 23 March 2022 by imported>Shirayuki (new tvar syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.24
Gerrit change 132695
<translate> MediaWiki version:</translate>

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 <translate> Required</translate>

Usage

php maintenance/pageExists.php "page title"


Terminal


Example echoing the exit status:

Terminal

Exit status = 0 means the page exists

Exit status = 1 means the page does NOT exist.

See also