Kézikönyv:PageExists.php
MediaWiki-verzió: | ≥ 1.24 Gerrit change 132695 |
MediaWiki-fájl: pageExists.php | |
---|---|
Könyvtár: | maintenance/ |
Forráskód: | master • 1.43.1 • 1.42.6 • 1.39.12 |
Osztályok: | PageExists |
Részletek
A pageExists.php az adott lap meglétét ellenőrző karbantartószkript. Az eredményt szövegesen jeleníti meg; ha létezik a lap, a kilépési értéke 0.
This script is very useful for bash and other scripting languages where we need to work with exit status code.
Options/Arguments
Argument | Leírás | Required? |
---|---|---|
<Page title> | Page title to be checked | Required |
Használat
php maintenance/run.php pageExists "page title"
Terminal
$ php maintenance/run.php pageExists "Main Page" Main Page exists.
In MediaWiki version 1.39.12 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.