Overview

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.

Setup

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"
	    ]
	  }
	}	
		

Submission

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.

Submit on packagist.org

It's helpful to set up SilverStripe with Composer, so you can test the installation.