Manage custom package using composer.

Submitted by editor on Tue, 01/03/2017 - 14:21
Question

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
    },

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.