Asaf Nevo
Asaf Nevo

Reputation: 11678

Php Composer import project as dependency

My project is based on another "core" project i've built.

I'm currently adding this "core" project to my project using git subtree command.

Is there a way that I can add the project as a dependency ? Can I add it as a (private) package ?

Upvotes: 0

Views: 879

Answers (1)

Pᴇʜ
Pᴇʜ

Reputation: 57683

If your core project already has a composer.json you can require it form any other project.

Here is an example for requiring from a bitbucket repo:

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

For more see the composer docs at using private repositories

Upvotes: 1

Related Questions