Create a private package?
Asked Answered
H

1

5

I'm creating a package but I would like to keep it private so only members of my dev team can use it.

I've checked this out on Google and Satis came back as an option.

I was just wondering do I need to use Satis to keep my package private or is there another way? Would a private repo on Git hub do the job?

Hawsehole answered 24/6, 2014 at 11:7 Comment(1)
Relevant: seld.be/notes/toran-proxy-and-the-future-of-composerJam
X
10

Yes you can use a Github private repo. I assume your intention is to use this package via composer. Simply add the below code to your composer file and replace the key values with your vendor/package name and the URL to the repository.

{
"require": {
    "vendor/my-private-repo": "dev-master"
},
"repositories": [
    {
        "type": "vcs",
        "url":  "github.org/vendor/my-private-repo.git"
    }
]
}

Here is the reference to the composer documentation on private repos:

https://getcomposer.org/doc/05-repositories.md#vcs

Xerography answered 24/6, 2014 at 12:53 Comment(4)
Thanks, will my package remain private though once published? I do not wish for people outside the dev team to use it?Hawsehole
What do you mean by publishing your private repo?Xerography
If it's private it must not be published in packagist.orgGainless
@drealecs: What the repositories key does is to point directly to GitHub instead of Packagist. Therefore, you don't have to publish to Packagist just get it to the private repo in GitHub, which will clone it. That's what Packagist is doing under the hood, and a couple other things I'm sure but unaware of.Goforth

© 2022 - 2024 — McMap. All rights reserved.