Composer: Difference between revisions

link to Jeroen's blog
No edit summary
Line 15: Line 15:
<li> Jeroen DeDauw wrote [https://www.entropywins.wtf/blog/2013/11/24/introduction-to-composer-for-mediawiki-developers/ this blog post in 2014] that is probably still not only relevant, but also contains wisdom not addressed in other places (e.g. Extension developers should specify <code>"type": "mediawiki-extension"</code> in their extension's composer.json so that Composer installs your package into the 'extensions' folder instead of the typical 'vendor' folder that is Composer's default.)
<li> Jeroen DeDauw wrote [https://www.entropywins.wtf/blog/2013/11/24/introduction-to-composer-for-mediawiki-developers/ this blog post in 2014] that is probably still not only relevant, but also contains wisdom not addressed in other places (e.g. Extension developers should specify <code>"type": "mediawiki-extension"</code> in their extension's composer.json so that Composer installs your package into the 'extensions' folder instead of the typical 'vendor' folder that is Composer's default.)
</ol>
</ol>
=== Use git checkouts ===
Say you installed Semantic Mediawiki with <code>composer require</code> and then when you went to your 'extensions' directory you were <i class="fa fa-frown-o"></i> because it wasn't a git checkout.  You can rectify that by redoing the command, but with the <code>--prefer-source</code> option.  nb. You first have to move the existing directory out of the way: <code>mv SemanticMediaWiki unused/</code> <code>cd ../ composer require --update-no-dev --sort-packages --optimize-autoloader -vvv mediawiki/semantic-media-wiki "~2.4" --prefer-source</code>


== Installation ==
== Installation ==