Manual:pageExists.php
MediaWiki バージョン: | ≧ 1.24 Gerrit change 132695 |
MediaWiki ファイル: pageExists.php | |
---|---|
場所: | maintenance/ |
ソース コード: | master • 1.43.1 • 1.42.6 • 1.39.12 |
クラス: | PageExists |
詳細
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.
オプション/引数
引数 | 説明 | 必須かどうか |
---|---|---|
<ページ名> | Page title to be checked | 必須 |
使用法
php maintenance/run.php pageExists "ページ名"
Terminal
$ php maintenance/run.php pageExists "Main Page" Main Page exists.
MediaWiki バージョン 1.39.12 以前では、メンテナンス スクリプトを
php maintenance/run.php scriptName
ではなく php maintenance/scriptName.php
を使用して実行する必要があります。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.