A
A
Alexander Evgenievich2015-01-23 19:00:50
symfony
Alexander Evgenievich, 2015-01-23 19:00:50

Composer, how to connect a project from a private repository to github?

Hello. There is a project on Symfony2 , you need to register a dependency on the bundle, which lies in a private repository on GitHub, so that, of course, this bundle will be pulled up when composer install\update . I looked at the composer repositories
doc , but I would like a live example regarding GitHub . How can I do that ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2015-09-03
@skobkin

Live example with names replaced.
Where you connect:

{
  "name": "somevendor/somenamespace/sometitle",
  "license": "Some license",
  "type": "library",
  "description": "Some description",
  "autoload": {
    "psr-0": { "SomeVendor\\SomeBundle": "src/" }
  },
  "require": {
    "vendor/library": "dev-master"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "extra": {
    "branch-alias": {
      "dev-master": "2.4-dev"
    }
  },
  "repositories": [
    {
      "type": "git",
      "url": "[email protected]:some-vendor/somelibrary.git"
    }
  ]
}

Where you connect:
{
    "name": "somevendor/somelibrary",
    "license": "MIT",
    "type": "library",
    "description": "Some description",
    "autoload": {
        "psr-0": { "": "src/" },
        "files": ["src/Vendor/path/file.php"]
    },
    "require": {
        "somevendor/somedependency" : "~2.4"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "extra": {
        "branch-alias": {
            "dev-master": "2.4-dev"
        }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question