Manual:exportSites.php
Appearance
MediaWiki ファイル: exportSites.php | |
---|---|
場所: | maintenance/ |
ソース コード: | master • 1.42.3 • 1.41.4 • 1.39.10 |
クラス: | ExportSites |
詳細
exportSites.php is a maintenance script that exports site definitions from the sites
table to an XML file.
引数
引数 | 説明 | 必須かどうか |
---|---|---|
file | File to write the XML. Use "php://stdout" to write to stdout. | 必須 |
使用法
php maintenance/exportSites.php file
Terminal
$ php maintenance/exportSites.php mywikisites.xml Exported sites to /var/www/html/wiki/maintenance/mywikisites.xml.
mywikisites.xml
<sites version="1.0" xmlns="http://www.mediawiki.org/xml/sitelist-1.0/">
<site type="mediawiki">
<globalid>hewikipedia</globalid>
<group>wikipedia</group>
<path type="page_path">https://he.wikipedia.org/index.php/</path>
<path type="file_path">https://he.wikipedia.org/</path>
</site>
<site type="mediawiki">
<globalid>hiwikipedia</globalid>
<group>wikipedia</group>
<path type="page_path">https://hi.wikipedia.org/index.php/</path>
<path type="file_path">https://hi.wikipedia.org/</path>
</site>
<site type="mediawiki">
<globalid>wikisite1</globalid>
<group>mywikigroup</group>
<path type="page_path">https://www.wikisite1.org/index.php/</path>
<path type="file_path">https://www.wikisite1.org/</path>
</site>
</sites>
よくあるエラー
- Failed to open $file for writing.
This error occurs when the user running the script does not have permission to write the file.
To resolve, check the user's permissions. If you are a root user, you can run the script with sudo.