2017 © Pedro Peláez
 

composer-plugin composer-preserve-paths

Composer plugin for preserving custom paths and supporting nested packages

image

deminy/composer-preserve-paths

Composer plugin for preserving custom paths and supporting nested packages

  • Friday, February 3, 2017
  • by deminy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Composer preserve paths

Build Status HHVM Status Latest Stable Version Latest Unstable Version License, (*1)

Composer plugin for preserving paths while installing, updating or uninstalling packages., (*2)

This way you can:, (*3)

  • provide custom files or directories that will not be overwritten on composer install or composer update
  • place packages within the directory of another package (using a composer installer like composer/installers or davidbarratt/custom-installer)

This plugin was originally developed by Johannes Haseitl. I updated it to allow wildcard pattern matching when defining preserved paths, which is necessary if you have many sites installed with same Drupal installation (i.e., you have many directories like example.com, example.net, example.org, etc under folder sites/ of your Drupal installation)., (*4)

Installation

Simply install the plugin with composer: composer require deminy/composer-preserve-paths, (*5)

Configuration

For configuring the paths you need to set preserve-paths within the extra of your root composer.json., (*6)

{
    "extra": {
        "preserve-paths": [
          "htdocs/sites/all/modules/contrib",
          "htdocs/sites/all/themes/contrib",
          "htdocs/sites/all/libraries",
          "htdocs/sites/all/drush",
          "htdocs/sites/*.com",
          "htdocs/sites/*.net",
          "htdocs/sites/*.org"
        ]
      }
}

Example

An example composer.json using davidbarratt/custom-installer:, (*7)

{
  "repositories": [
    {
      "type": "composer",
      "url": "https://packagist.drupal-composer.org/"
    }
  ],
  "require": {
    "davidbarratt/custom-installer": "dev-master",
    "deminy/composer-preserve-paths": "dev-master",
    "drupal/views": "7.*",
    "drupal/drupal": "7.*"
  },
  "config": {
    "vendor-dir": "vendor"
  },
  "extra": {
    "custom-installer": {
      "drupal-module":  "htdocs/sites/all/modules/contrib/{$name}/",
      "drupal-theme":   "htdocs/sites/all/themes/contrib/{$name}/",
      "drupal-library": "htdocs/sites/all/libraries/{$name}/",
      "drupal-drush":   "htdocs/sites/all/drush/{$name}/",
      "drupal-profile": "htdocs/profiles/{$name}/",
      "drupal-core":    "htdocs/"
    },
    "preserve-paths": [
      "htdocs/sites/all/modules/contrib",
      "htdocs/sites/all/themes/contrib",
      "htdocs/sites/all/libraries",
      "htdocs/sites/all/drush",
      "htdocs/sites/*.com",
      "htdocs/sites/*.net",
      "htdocs/sites/*.org"
    ]
  }
}

The Versions

03/02 2017

dev-master

9999999-dev https://github.com/deminy/composer-preserve-paths

Composer plugin for preserving custom paths and supporting nested packages

  Sources   Download

GPL-2.0+

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

installer composer-plugin custom path nested package

03/02 2017

0.1.4

0.1.4.0 https://github.com/deminy/composer-preserve-paths

Composer plugin for preserving custom paths and supporting nested packages

  Sources   Download

GPL-2.0+

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

installer composer-plugin custom path nested package