Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Manage custom package using composer.

By editor , 3 January, 2017
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
    },

Install drupal with custom repository (Example)

composer create-project VENDER/DRUPAL --repository-url https://packages.example.com/packages.json

 

File
youtubeapi.zip (30.72 KB)

Tags

  • Drupal 8
  • Code
  • Composer
Create a Drupal 9 Project using composer.
Install and Update Composer
Download and Install Composer on Linux
Install drupal 8, modules and themes from Drush.

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer