Difference between revisions of "Composer"
Jump to navigation
Jump to search
m (typo) |
(adds info about using Composer with MediaWiki) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
<li> [[mw:Composer/For extensions]] on using Composer to manage extensions | <li> [[mw:Composer/For extensions]] on using Composer to manage extensions | ||
<li> [[mw:Manual:composer.json best practices]] for how to add Composer support to your extensions (including extension.json and skin.json) | <li> [[mw:Manual:composer.json best practices]] for how to add Composer support to your extensions (including extension.json and skin.json) | ||
− | |||
</ol> | </ol> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Installation == | == Installation == | ||
Line 65: | Line 41: | ||
</source> | </source> | ||
+ | == More == | ||
− | + | To use [https://getcomposer.org/ Composer] in your PHP project, see this [http://daylerees.com/composer-primer primer], and also this handy-dandy [http://composer.json.jolicode.com/ cheatsheet] (with mouseovers!) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Composer | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Development]] | [[Category:Development]] | ||
[[Category:Tools]] | [[Category:Tools]] | ||
[[Category:PHP]] | [[Category:PHP]] |
Revision as of 08:32, 4 November 2016
Contents
Intro[edit | edit source]
Composer is one of many Dependency managers. Composer makes it easier to distribute PHP code that relies on other code.
in MediaWiki[edit | edit source]
- mw:Composer is used in the MediaWiki engine to manage all core libraries and dependencies since version 1.25 (including composer-local.json)
cd $IP cp composer.local.json-sample composer.local.json composer update --no-dev --dry-run
- mw:Composer/For extensions on using Composer to manage extensions
- mw:Manual:composer.json best practices for how to add Composer support to your extensions (including extension.json and skin.json)
Installation[edit | edit source]
Installing it on your own host would look something like this
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# now you can use it to do things like install the latest version of Drush
composer global require drush/drush:dev-master
while installing it on a shared host like WebFaction would be slightly modified
ln -s `which php54` ~/bin/php
curl -sS https://getcomposer.org/installer | php54
mv composer.phar ~/bin/composer
echo -e '\n# Composer\nalias composer="php54 $HOME/composer.phar"' >> ~/.bash_profile
source ~/.bash_profile
which composer
# now you can use it to do things like install the latest version of Drush
composer global require drush/drush:dev-master
drush --version
More[edit | edit source]
To use Composer in your PHP project, see this primer, and also this handy-dandy cheatsheet (with mouseovers!)