R
R
romany42014-09-18 23:40:20
PHP
romany4, 2014-09-18 23:40:20

How to set dependencies for a project via composer?

There are repositories on the server
- project A (library)
- project B (C, D, etc)
How can I set project B as a dependency on project A through composer. (what should be their composer.json files)
ps. rights are controlled by gitolite
pps must be allowed without using external services (github, etc)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Philipp, 2014-09-19
@romany4

Instead of a git hub, there may be your address.

{
  "repositories": [{
      "type": "vcs",
      "url": "https://login:[email protected]/neitanod/forceutf8.git"
    }],

  "require": {
    "neitanod/forceutf8": "dev-master",
},
  "config": {
    "vendor-dir": "path/to/vendor"
  }
}

Please note that the repository also has a composer configuration file https://github.com/neitanod/forceutf8/blob/master/...
Also packagist.org will help you.

S
Sergey, 2014-09-19
Protko @Fesor

composer knows how to work with GIT repositories. You just have to write the repository for this package in the composer.json of each project.
More details in the documentation. https://getcomposer.org/doc/04-schema.md#repositories

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question