SilverStripe modules are managed through Composer, a dependency manager for PHP. It takes care of downloading modules and installing them into your project.
Each module needs to be registered on packagist.org, which is a central repository used by Composer. The addons.silverstripe.org project doesn't interact directly with Composer, store module metadata, or provide module downloads.
If you want to learn about creating modules with SilverStripe, read our "Module Development" guide.
First of all, your project needs to be in version control. Packagist supports Git, Subversion and Mercurial.
You need to add a composer.json
file in the root of your module. Here's an example which you can customize.
{ "name": "your-vendor-name/module-name", "description": "One-liner describing your module", "type": "silverstripe-module", "homepage": "http://github.com/your-vendor-name/module-name", "keywords": ["silverstripe", "some-tag", "some-other-tag"], "license": "BSD-3-Clause", "authors": [ {"name": "Your Name","email": "[email protected]"} ], "support": { "issues": "http://github.com/your-vendor-name/module-name/issues" }, "require": { "silverstripe/cms": "~3.0", "silverstripe/framework": "~3.0" }, "extra": { "installer-name": "elastica", "screenshots": [ "relative/path/screenshot1.png", "http://myhost.com/screenshot2.png" ] } }
3.0.*
: Version 3.0
, including 3.0.1
, 3.0.2
etc, excluding 3.1
~3.0
: Version 3.0
or higher, including 3.0.1
and 3.1
etc, excluding 4.0
~3.0,<3.2
: Version 3.0
or higher, up until 3.2
, which is excluded~3.0,>3.0.4
: Version 3.0
or higher, starting with 3.0.4
0.5
branch might require SilverStripe 2.4)
Now you're ready to submit the module. Please note that it takes a couple of minutes for the changes to be picked up by addons.silverstripe.org.
It's helpful to set up SilverStripe with Composer, so you can test the installation.