Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

composer is ignoring installer-paths configuration

I'm try using CakePHP for the first time with composer, but I have some problems.

I have this composer.json:

{
  "name": "example.com.br",
  "repositories": [
    {
      "type": "pear",
      "url": "http://pear.cakephp.org"
    }
  ],
  "config": {
    "vendor-dir": "Vendor/"
  },
  "require": {
    "php": ">=5.4",
    "pear-cakephp/cakephp": ">=2.4.3",
    "cakephp/debug_kit": "2.2.*",
    "smottt/wideimage": "dev-master"
  },
  "extra": {
    "installer-paths": {
      "app/Plugin/DebugKit": ["cakephp/debug_kit"],
      "app/Vendor/Wideimage": ["smottt/wideimage"]
    }
  }  
}

When I run composer install (or update) --prefer-dist, everything works except smottt/wideimage.

This package is being installed in the /Vendor folder instead /app/Vendor, so, installer-paths was ignored.

like image 783
Patrick Maciel Avatar asked Dec 05 '13 17:12

Patrick Maciel


1 Answers

Of course, what Danack has said is true: the composer-installers plugin only supports a select list of package types.

In response to that, I have written an extension for the composer-installers plugin which allows any arbitrary package type to be handled by the "installer-paths" directive.

Simply require oomphinc/composer-installers-extender in your composer.json and add support for any additional arbitrary package types:

"extra": {
  "installer-types": ["library"],
  "installer-paths": {
    "special/package/": ["my/package"],
    "path/to/libraries/{$name}/": ["type:library"]
  }
}

For packages that don't specify a type, use the default type library.

like image 144
Stephen B Avatar answered Nov 09 '22 09:11

Stephen B