Composer: Difference between revisions

link to subpage
Line 20: Line 20:


=== With Meza ===
=== With Meza ===
=== MezaLocalExtensions.yml ===
If the extension should be '''installed''' by Composer, then use a stanza like:
<syntaxhighlight lang="yaml">
- name: Mermaid
  composer: "mediawiki/mermaid"
  version: ~2.2
  config: |
    wfLoadExtension( 'Mermaid' );
    $mermaidgDefaultTheme = 'neutral';
</syntaxhighlight>
If the extension source is controlled by [[git]], and you want to have the extension's <tt>composer.json</tt> file "seen" (merged) by MediaWiki, then simply add the line:
    composer_merge: true
to the 'normal' extension stanza specifying the source.
=== Install libraries ===
In general, if you want to install something into your MediaWiki instance, you can do the following from the '$IP' (Install Path) directory:
<syntaxhighlight lang="bash">
# add the library to composer.local.json
COMPOSER=composer.local.json composer require --no-update mwstake/mediawiki-component-events:~4
# install it to 'vendor' without dev requirements and optimize the autoloader
composer update mwstake/mediawiki-component-events --no-dev -o
# check to see that it's installed
composer show |grep mwstake
</syntaxhighlight>
=== Check / Overwrite Local Modifications ===
If you're using [[Meza]] to deploy your MediaWiki platform, you may wonder whether there are local modifications that a new deploy could overwrite.
If you're using [[Meza]] to deploy your MediaWiki platform, you may wonder whether there are local modifications that a new deploy could overwrite.