Manual:PageExists.php
Appearance
| Versión de MediaWiki: | ≥ 1.24 Gerrit change 132695 |
| Archivo de MediaWiki: pageExists.php | |
|---|---|
| Ubicación: | maintenance/ |
| Código fuente: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Clases: | PageExists |
Detalles
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 | Descripción | Required? |
|---|---|---|
| <Page title> | Page title to be checked | Required |
Uso
php maintenance/run.php pageExists "page title"
Terminal
$ php maintenance/run.php pageExists "Main Page" Main Page exists.
In MediaWiki version 1.43.6 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php instead of php maintenance/run.php scriptName.Example echoing the exit status:
Terminal
$ php maintenance/run.php pageExists "Main Page" ; echo "Exit Status" $? Main Page exists. Exit Status 0
Exit status 0 means the page exists. Exit status 1 means the page does NOT exist.