How to manage a custom packages using composer.
Composer can hadle CVS (git, svn ...) and ZIP packages.
To install/Update your custom modules, add a custom repository to the composer.json file, following this example.
1. Add package repositories
Here, youtubeapi and sadb
2. Require packages to install
Here, iwsp/youtubeapi and iwsp/sadb
3. Run: composer update
"repositories": {
"youtubeapi": {
"type": "package",
"package": {
"name": "iwsp/youtubeapi",
"version": "1.0.2",
"type": "drupal-module",
"dist": {
"url": "https://drupal8.ovh/sites/drupal/files/2017-01/youtubeapi.zip",
"type": "zip"
}
}
},
"sadb": {
"type": "package",
"package": {
"name": "iwsp/sadb",
"type": "drupal-module",
"version": "1.0.0",
"source": {
"url": "https://git.drupal.org/sandbox/NuWans/2795593",
"type": "git",
"reference": "8.x-1.x"
}
}
}
},
"require": {
"composer/installers": "^1.0.21",
"wikimedia/composer-merge-plugin": "~1.3",
"drupal/core": "^8.2",
"iwsp/youtubeapi": "^1.0",
"iwsp/sadb": "*"
},
Note : If you are using http:// (not https://) add following config. But its recomended to use SSL.
"config": {
"secure-http": false
},
Install drupal with custom repository (Example)
composer create-project VENDER/DRUPAL --repository-url https://packages.example.com/packages.json
Comments