A
A
Andrey2018-06-05 16:38:10
Composer
Andrey, 2018-06-05 16:38:10

How to properly use composer/installers with installer-paths?

Good afternoon!
Can't figure out how to properly use custom install paths with the installer(composer/installers)?
Registered in the require of the package:

"require": {
    "php": ">=5.4.0",
    "composer/installers": "~1.0"
  }

then everything in the same composer.json wrote:
"extra": {
    "installer-paths": {
      "modules/{$name}": ["type:my-module"]
    }
  }

where my-module is the type of my package, i.e. in the package itself I wrote:
"type": "my-module",
I also tried to write it like this:
"extra": {
    "installer-paths": {
      "modules/{$name}": ["repositoryName/packageName"]
    }
  }

also like this:
"extra": {
    "installer-paths": {
      "modules/{$name}/": ["repositoryName/packageName", "vendor/package"]
    }
  }

though I didn’t understand that there is vendor/package as the second parameter...
Even in the root (head) composer.json, I use Yii2, I wrote:
"installer-paths": {
     "modules/{$name}": ["type:my-module"]
 }

Question: What am I doing wrong?
ZY: in general, I need to install packages inside another package that is already installed in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jkd, 2018-06-05
@jkd

Packages are not (shouldn't) installed inside your package. They go in the require section as used by your package. Those .. If they were not in the vendor before, then yes .. they will be pumped ... If they already were, there will be a check for the correct versions and they will not download ...
And I add my packages through the internal repository (which I collect in a separate folder)
"repositories": [
{
"type": "path",
"url": "packages/MyRepo/*"
},
{
"type": "path",
"url": "packages/MyRepo/CMSModules /*"
}
],
and if necessary,
"php": ">=5.6.4",
......
"MyRepo/MyModule1":"*"
},

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question