跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
天灾之下:危险连接官网(建设中)
天灾之下:危险连接QQ群
天灾之下:危险连接 Bilibili
冰糖服务器
冰糖服务器QQ群
天灾之下:危险连接资料站
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模板:ExtensionInstallComposer”︁的源代码
模板
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
[[雷光]]
外观
移至侧栏
隐藏
←
模板:ExtensionInstallComposer
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
<noinclude>This template can be used on extension description pages, where the extension features a <code>composer.json</code> with a proper <code>name</code> and <code>type</code> attribute. It is based on [[Composer/For_extensions#Installing_extensions_that_are_not_available_from_Packagist ]]. ; Example 1 - Version tag releases <syntaxhighlight lang=wikitext> {{ExtensionInstallComposer |MyExtension |vcs=https://github.com/wikimedia/mediawiki-extensions-MyExtension.git |packageName=mediawiki/my-extension |versionConstraint=1.0.* }} </syntaxhighlight> ; Result : {{ExtensionInstallComposer |MyExtension |vcs=https://github.com/wikimedia/mediawiki-extensions-MyExtension.git |packageName=mediawiki/my-extension |versionConstraint=dev-REL1_43 }} ; Example 2 - LTS bound releases <syntaxhighlight lang=wikitext> {{ExtensionInstallComposer|MyExtension |vcs=https://github.com/wikimedia/mediawiki-extensions-MyExtension.git |packageName=mediawiki/my-extension |versionConstraint=1.0.* }} </syntaxhighlight> ; Result : {{ExtensionInstallComposer|MyExtension |vcs=https://github.com/wikimedia/mediawiki-extensions-MyExtension.git |packageName=mediawiki/my-extension |versionConstraint=dev-REL1_43 }} </noinclude><includeonly> * Add the repo url ({{{vcs|}}}) as a "vcs repository" and the package name ({{{packageName|}}}) and version to the <code>require</code> section of your [[composer.local.json|<code>composer'''.local'''.json</code>]]. Example: : {{#tag:syntaxhighlight| { "repositories": [ { "type": "vcs", "url": "{{{vcs|}}}" } ], "require": { "{{{packageName|}}}": "{{{versionConstraint|}}}" } } |lang="json" }} * Run the following command in your MediaWiki installation path : {{#tag:syntaxhighlight| composer update --no-dev |lang="shell-session" }} * Add the following code at the bottom of your [[Special:MyLanguage/Manual:LocalSettings.php|LocalSettings.php]] file: : {{#tag:syntaxhighlight| wfLoadExtension( '{{trim|{{{1|}}}}}' ); |lang="php" }} * {{Done|uselang={{pagelang}}}} Navigate to [[Special:Version]] on your wiki to verify that the extension is successfully installed. </includeonly>
该页面嵌入的页面:
模板:Done
(
查看源代码
)
模板:ExtensionInstallComposer
(
查看源代码
)
模板:Tick
(
查看源代码
)
模板:Trim
(
查看源代码
)
返回
模板:ExtensionInstallComposer
。
搜索
搜索
查看“︁模板:ExtensionInstallComposer”︁的源代码
添加语言
添加话题