I am a huge fan of composer. PW ( ProcessWire) is missing one of the good parts of composer. So here is a new installer to install the 3rd party modules of PW via composer.
If you have created a module for PW, what you need to do is add a
composer.json file in your github repo and add it to packagist.
An example composer.json is
|
|
Note the minimum requirement is PHP 5.3 for composer is 5.3 .
An example of a module that works with this is https://github.com/harikt/Assets ( Move the index.php to any where :-) ). You are read more about Assets from here
Installing modules #
How do you install the PW modules and the 3rd party dependencies ? Assuming you are in the PW folder.
First download composer from http://getcomposer.org/download/.
Hope you have composer.phar now.
|
|
Will install if the vendor/package-name to site/modules/PackageName.
All packages vendor/package-name of "type": "pw-module" will be converted to PackageName.
Example you can try
|
|
Try the above and see where it is installed. If you are a module maintainer,
please add a composer.json to your github module and add it to packagist.
Of-course inspired and modified composer installer from Aura Project for PHP
Thank you. Happy PhPing!