samwilson/mwcli
Composer 安装命令:
composer require samwilson/mwcli
包简介
A Command Line Interface for managing MediaWiki installations.
关键字:
README 文档
README
A command line client for MediaWiki wikis.
- Homepage: https://mwcli.toolforge.org
- Source code: https://gitlab.wikimedia.org/toolforge-repos/mwcli
- Issue tracker: https://phabricator.wikimedia.org/tag/tool-mwcli/
About
MediaWiki CLI (or mwcli for short) is a multilingual cross-platform PHP command-line tool
for interacting with MediaWiki installations,
to carry out tasks such as uploading and downloading files, and exporting pages.
It is designed to operate on multiple wikis
and the configuration for these is stored in the config.yml file.
The wikis are usually remote from the computer on which wmcli is run,
but can also be local (i.e. it can be used on a server to perform some tasks).
The config file can be edited directly,
or via commands such as sites:add and sites:modify.
Installation
Clone the repository:
git clone https://gitlab.wikimedia.org/toolforge-repos/mwcli.gitInstall dependencies:
cd mwcli composer install --no-devOptionally add
mwclito your $PATH. For example, on Linux:echo 'export PATH=$PATH:'$(pwd)/bin >> ~/.profile
Upgrading
Update the code:
cd mwcli git pull origin mainUpdate dependencies:
composer install --no-dev
Usage
sites:add
Add a new site to the config file.
sites:add [-c|--config [CONFIG]] [--url URL]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--url— The URL of the wiki. Can be to any page or even api.php. Required.
sites:info
Get general information about a wiki.
sites:info [-c|--config [CONFIG]] [-w|--wiki WIKI]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.
sites:list
List all configured sites.
sites:list [-c|--config [CONFIG]]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'
sites:remove
Remove a site from the config file.
sites:remove [-c|--config [CONFIG]] [-w|--wiki WIKI]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.
export:category
Export pages and files in a category (and its subcategories).
export:category [-c|--config [CONFIG]] [-w|--wiki WIKI] [-a|--category CATEGORY] [-d|--dest DEST]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.--category-a— Name of the category to export (with or without the leading 'Category:', and in any language). Required.--dest-d— The destination directory for exported files. Default: '[CWD]/categories'
export:contribs
Export a user's contributions.
export:contribs [-c|--config [CONFIG]] [-w|--wiki WIKI] [-u|--user USER] [-d|--dest DEST] [-o|--only-author]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.--user-u— Export contributions of this username. Required.--dest-d— The destination directory for exported files. Default: '[CWD]/contribs'--only-author-o— Export only where the given user is the original author of a page.
export:wikitext
Export a wiki's pages as text files.
export:wikitext [-c|--config [CONFIG]] [-w|--wiki WIKI] [-d|--dest DEST] [-e|--ext EXT]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.--dest-d— The destination directory for exported files. Default: '[CWD]/wikitext'--ext-e— File extension to use for the exported files. Default: 'txt'
extension:install
Install an extension into a local wiki. Requires 'install_path' to be set in a site's config.
extension:install [-c|--config [CONFIG]] [-w|--wiki WIKI] [-g|--git] [-u|--gituser GITUSER] [--] <extension-name>
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.--git-g— Use Git to install the extension, instead of the default tarball method.--gituser-u— The username to use for Git. Implies --git Required.<extension-name>The extension's name (CamelCase, with underscores for spaces).
extension:outdated
Shows a list of installed extensions that have updates available, including their latest version.
extension:outdated [-c|--config [CONFIG]] [-w|--wiki WIKI]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.
upload:files
Upload local files to a wiki.
upload:files [-c|--config [CONFIG]] [-w|--wiki WIKI] [-m|--comment COMMENT] [--] [<files>...]
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.--comment-m— Revision comment. Required.<files>Filenames of files to upload.
upload:pages
Upload local text files as wiki pages.
upload:pages [-c|--config [CONFIG]] [-w|--wiki WIKI] [-m|--comment [COMMENT]] [-t|--watch] [--] <pages-dir>
--config-c— Path of the Yaml config file to use. Default: '[CONFIG]/mwcli/config.yml'--wiki-w— The mwcli name of the wiki to use. Use sites:list to list all. Required.--comment-m— Revision comment.--watch-t— Keep watching the files and upload on any change.<pages-dir>Directory from which to import wiki pages.
License: MIT
Copyright 2019 Sam Wilson.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
samwilson/mwcli 适用场景与选型建议
samwilson/mwcli 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 07 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「mediawiki」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 samwilson/mwcli 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 samwilson/mwcli 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 samwilson/mwcli 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
An extension to Semantic MediaWiki allowing to build breadcrumb links from an attributive property filter
Helper functions for the MediaWiki ExtensionRegistry
Adds the EDTF data type to Wikibase
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
A highly flexible MediaWiki skin using Twitter Bootstrap 3
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-20