我正在尝试使用Ansible和Wikimedia 命令行安装脚本自动化维基媒体的安装。
我注意到当前版本包含用于安装扩展的脚本参数。在脚本帮助命令中:
$ php maintenance/install.php --help
CLI-based MediaWiki installation and configuration.
Default options are indicated in parentheses.
Usage: php install.php [--conf|--confpath|--dbgroupdefault|--dbname|--dbpass|--dbpassfile|--dbpath|--dbport|--dbprefix|-
-dbschema|--dbserver|--dbtype|--dbuser|--env-checks|--extensions|--globals|--help|--installdbpass|--installdbuser|--lang
|--memory-limit|--mwdebug|--pass|--passfile|--profiler|--quiet|--scriptpath|--server|--skins|--wiki|--with-extensions] [
name] <admin>
...
Script specific parameters:
--extensions: Comma-separated list of extensions to install
--with-extensions: Detect and include extensions但是,我无法找到关于如何最好地使用这些参数的任何其他信息。install.php脚本或扩展上的维基媒体手册页面都没有记录它们:
有人能告诉我关于这些参数的更多细节文档或提供如何使用它们的示例吗?
我计划做一些尝试和错误,并将自己回答这个问题,如果我知道他们如何工作之前,其他人的回答。但是我知道扩展安装会变得很复杂,通常需要更新配置文件,所以我希望能找到一些现有的文档来指导我。
发布于 2019-04-08 01:01:39
简短回答
这些扩展参数只需在LocalSettings.php文件中添加一行,如果在extensions目录中找到指定的扩展名,则在运行时加载扩展名。
长答案
我玩过这个了。我测试了--with-extensions,根据帮助文档,will detect and include extensions。这似乎意味着它将扫描扩展目录并安装它在那里找到的任何扩展。
我运行了以下命令:
php maintenance/install.php --with-extensions --dbserver="localhost" --dbname=foo --dbuser=foo --dbpass=foo --server="https://wiki.foo.localhost" --script path=/mediawiki -en --pass=foo "My Wiki Name" "Admin"它在我的LocalSettings.php配置文件中生成了以下块,列出了当前版本的Mediawiki核心包含的默认包:
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'WikiEditor' );这个参数的复杂性,很可能是明智的,不过仅此而已。
我试着运行这个命令来查看--extensions=GoogleLogin参数是否会自动安装GoogleLogin扩展。但事实并非如此。相反,它报告了这个错误:
Could not find the registration file for the extension "GoogleLogin"所以,如果你在寻找一个功能更全面的作曲家式的扩展包管理器,这不是它。
当我下载GoogleLogin扩展并将其放在extensions目录中并运行--with-extensions参数时,它确实将它包含在配置文件扩展名块中。
在没有显式测试的情况下,我得出结论,--extensions参数的操作方式与--with-extensions相同,只不过它将只重写那些显式指定并在extensions目录中找到的扩展到LocalSettings.php配置文件。
https://stackoverflow.com/questions/55434197
复制相似问题