Phill Pafford
Phill Pafford

Reputation: 85318

Composer with local SVN repo

I'm trying to run composer using a local SVN repo, I can hit the repo I want but composer keeps adding the /branch to the end of the URL.

How can I override this?

Here are the docs:

Example of what I have

"repositories": [
    {
        "type": "vcs",
        "url": "http://host.com/externals/project",
        "trunk-path": "trunk",
        "branches-path": "branches",
        "tags-path": "tags",
        "reference": "symfony/symfony"
    }
],
"require": {
    "project/project": "svn-project"
}

Output is something like this:

[RuntimeException]                                                                                                                                                      
Repository http://host.com/externals/project/version could not be processed, 
svn: URL 'http://host.com/externals/project/version/branches' 
non-existent in that revision 

Here is my subversion layout:

http://host.com/externals/project/version

So my svn repo is like:

http://host.com/externals/symfony/2.1.2

any thoughts?

this is how the company I work for stores external libraries we are using

UPDATE:

I've changed our repo to this:

http://host.com/externals/symfony/trunk/ <-- empty directory
http://host.com/externals/symfony/branches/ <-- empty directory
http://host.com/externals/symfony/trunk/2.1.2 <-- holds the Symfony 2.1.2 release code

Now I get this message:

Reading composer.json of http://host.com/externals/symfony/ (2.1.2)
Importing tag 2.1.2 (2.1.2.0)

but it then still pulls from the github repo instead of my svn repo.

I've also read on Satis

but if I do there where do I host this?

Upvotes: 5

Views: 8099

Answers (1)

bahrep
bahrep

Reputation: 30662

Looks like Composer assumes you stick to the common repository layout of /trunk, /branches, and /tags. Plus you must enter the URL to the repository root--not the full project path. You specify the project-specific path with package-path.

See the doc Composer | Subversion Options.

Since Subversion has no native concept of branches and tags, Composer assumes by default that code is located in $url/trunk, $url/branches and $url/tags. If your repository has a different layout you can change those values.

Upvotes: 4

Related Questions